@sciol/xyzen 0.3.6 → 0.3.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.
Files changed (53) hide show
  1. package/dist/app/AppFullscreen.d.ts +1 -1
  2. package/dist/app/explore/AgentExploreContent.d.ts +3 -0
  3. package/dist/app/explore/AgentExploreTab.d.ts +2 -0
  4. package/dist/app/explore/McpExploreContent.d.ts +3 -0
  5. package/dist/app/explore/McpExploreTab.d.ts +2 -0
  6. package/dist/components/animate-ui/components/buttons/button.d.ts +1 -1
  7. package/dist/components/animate-ui/components/buttons/github-stars.d.ts +10 -0
  8. package/dist/components/animate-ui/components/headless/checkbox.d.ts +11 -0
  9. package/dist/components/animate-ui/components/radix/dropdown-menu.d.ts +37 -0
  10. package/dist/components/animate-ui/components/radix/tooltip.d.ts +10 -0
  11. package/dist/components/animate-ui/primitives/animate/github-stars.d.ts +40 -0
  12. package/dist/components/animate-ui/primitives/effects/highlight.d.ts +1 -1
  13. package/dist/components/animate-ui/primitives/effects/particles.d.ts +25 -0
  14. package/dist/components/animate-ui/primitives/headless/checkbox.d.ts +16 -0
  15. package/dist/components/animate-ui/primitives/radix/dropdown-menu.d.ts +57 -0
  16. package/dist/components/animate-ui/primitives/radix/tooltip.d.ts +21 -0
  17. package/dist/components/animate-ui/primitives/texts/sliding-number.d.ts +16 -0
  18. package/dist/components/base/Badge.d.ts +1 -1
  19. package/dist/components/features/ExploreMcpCard.d.ts +6 -0
  20. package/dist/components/features/ExploreMcpListItem.d.ts +6 -0
  21. package/dist/components/layouts/XyzenAgent.d.ts +3 -1
  22. package/dist/components/ui/3d-card.d.ts +23 -0
  23. package/dist/components/ui/3d-pin.d.ts +12 -0
  24. package/dist/components/ui/background-boxes.d.ts +7 -0
  25. package/dist/components/ui/background-gradient-animation.d.ts +16 -0
  26. package/dist/components/ui/bento-grid.d.ts +11 -0
  27. package/dist/components/ui/button.d.ts +10 -0
  28. package/dist/components/ui/layout-text-flip.d.ts +5 -0
  29. package/dist/components/ui/pagination.d.ts +13 -0
  30. package/dist/components/ui/shooting-stars.d.ts +14 -0
  31. package/dist/components/ui/spotlight-new.d.ts +13 -0
  32. package/dist/hooks/use-data-state.d.ts +4 -0
  33. package/dist/hooks/use-is-in-view.d.ts +12 -0
  34. package/dist/lib/animations.d.ts +48 -0
  35. package/dist/marketplace/components/McpActivationProgress.d.ts +10 -0
  36. package/dist/marketplace/components/McpServerCard.d.ts +9 -0
  37. package/dist/marketplace/components/McpServerDetail.d.ts +7 -0
  38. package/dist/marketplace/components/UnifiedMcpMarketList.d.ts +8 -0
  39. package/dist/marketplace/hooks/useBohriumMcp.d.ts +61 -0
  40. package/dist/marketplace/index.d.ts +12 -0
  41. package/dist/marketplace/services/bohriumService.d.ts +34 -0
  42. package/dist/marketplace/types/bohrium.d.ts +129 -0
  43. package/dist/marketplace/utils/starredApps.d.ts +37 -0
  44. package/dist/service/mcpService.d.ts +2 -2
  45. package/dist/store/slices/agentSlice.d.ts +9 -0
  46. package/dist/store/slices/mcpSlice.d.ts +3 -3
  47. package/dist/types/mcp.d.ts +42 -2
  48. package/dist/utils/mcpConverters.d.ts +32 -0
  49. package/dist/xyzen.css +1 -1
  50. package/dist/xyzen.es.js +36809 -29620
  51. package/dist/xyzen.umd.js +179 -94
  52. package/package.json +17 -3
  53. /package/dist/{components/layouts/Explorer.d.ts → app/explore/page.d.ts} +0 -0
@@ -0,0 +1,61 @@
1
+ import { McpActivationProgress } from '../types/bohrium';
2
+ /**
3
+ * 使用 Bohrium 应用列表 (with React Query)
4
+ */
5
+ export declare const useBohriumAppList: (page?: number, pageSize?: number, searchQuery?: string) => {
6
+ apps: import('..').BohriumApp[];
7
+ totalCount: number;
8
+ totalPages: number;
9
+ currentPage: number;
10
+ loading: boolean;
11
+ error: string | null;
12
+ isError: boolean;
13
+ refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<import('..').BohriumAppListResponse, Error>>;
14
+ prefetchNextPage: () => void;
15
+ };
16
+ /**
17
+ * 使用 Bohrium 应用列表(无限加载版)
18
+ */
19
+ export declare const useBohriumInfiniteAppList: (pageSize?: number, searchQuery?: string) => {
20
+ apps: import('..').BohriumApp[];
21
+ totalCount: number;
22
+ totalPages: number;
23
+ pageCount: number;
24
+ loading: boolean;
25
+ isFetchingNextPage: boolean;
26
+ hasNextPage: boolean;
27
+ fetchNextPage: (options?: import('@tanstack/query-core').FetchNextPageOptions) => Promise<import('@tanstack/query-core').InfiniteQueryObserverResult<import('@tanstack/query-core').InfiniteData<import('..').BohriumAppListResponse, unknown>, Error>>;
28
+ refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<import('@tanstack/query-core').InfiniteData<import('..').BohriumAppListResponse, unknown>, Error>>;
29
+ error: string | null;
30
+ isError: boolean;
31
+ };
32
+ /**
33
+ * 使用 Bohrium 应用详情 (with React Query)
34
+ */
35
+ export declare const useBohriumAppDetail: (appKey?: string) => {
36
+ detail: import('..').BohriumAppDetail | null;
37
+ loading: boolean;
38
+ error: string | null;
39
+ isError: boolean;
40
+ refetch: (options?: import('@tanstack/query-core').RefetchOptions) => Promise<import('@tanstack/query-core').QueryObserverResult<import('..').BohriumAppDetail, Error>>;
41
+ };
42
+ /**
43
+ * 使用 MCP 激活流程
44
+ */
45
+ export declare const useMcpActivation: () => {
46
+ progress: McpActivationProgress;
47
+ activateMcp: (appKey: string) => Promise<{
48
+ detail: import('..').BohriumAppDetail;
49
+ endpoint: {
50
+ url: string;
51
+ token: string;
52
+ };
53
+ }>;
54
+ reset: () => void;
55
+ };
56
+ /**
57
+ * 检查 Bohrium 认证状态
58
+ */
59
+ export declare const useBohriumAuth: () => {
60
+ isAuthenticated: boolean;
61
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Marketplace Module Entry
3
+ * 统一导出 marketplace 模块的所有功能
4
+ */
5
+ export * from './types/bohrium';
6
+ export { bohriumService } from './services/bohriumService';
7
+ export { useBohriumAppDetail, useBohriumAppList, useBohriumAuth, useMcpActivation, } from './hooks/useBohriumMcp';
8
+ export { default as McpActivationProgress } from './components/McpActivationProgress';
9
+ export { default as McpServerCard } from './components/McpServerCard';
10
+ export { default as McpServerDetail } from './components/McpServerDetail';
11
+ export { default as UnifiedMcpMarketList } from './components/UnifiedMcpMarketList';
12
+ export * from './utils/starredApps';
@@ -0,0 +1,34 @@
1
+ import { BohriumAppDetail, BohriumAppListResponse } from '../types/bohrium';
2
+ /**
3
+ * Bohrium Service 类
4
+ */
5
+ declare class BohriumService {
6
+ /**
7
+ * 获取 MCP 应用列表
8
+ */
9
+ getAppList(page?: number, pageSize?: number, search?: string): Promise<BohriumAppListResponse>;
10
+ /**
11
+ * 获取应用详情(包含 latestDeploymentId)
12
+ */
13
+ getAppDetail(appKey: string): Promise<BohriumAppDetail>;
14
+ /**
15
+ * 获取 MCP 服务端点配置
16
+ */
17
+ getMcpEndpoint(deploymentId: number): Promise<{
18
+ url: string;
19
+ token: string;
20
+ }>;
21
+ /**
22
+ * 轮询获取 MCP 端点(处理沙盒启动延迟)
23
+ */
24
+ waitForMcpEndpoint(deploymentId: number, maxRetries?: number, retryInterval?: number, onProgress?: (retryCount: number, maxRetries: number) => void): Promise<{
25
+ url: string;
26
+ token: string;
27
+ }>;
28
+ /**
29
+ * 检查是否已认证
30
+ */
31
+ isAuthenticated(): boolean;
32
+ }
33
+ export declare const bohriumService: BohriumService;
34
+ export {};
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Bohrium Marketplace Types
3
+ * 定义 Bohrium 平台相关的数据类型
4
+ */
5
+ /**
6
+ * Bohrium 应用基础信息
7
+ */
8
+ export interface BohriumApp {
9
+ id: number;
10
+ appKey: string;
11
+ appUuid: string;
12
+ title: string;
13
+ description: string;
14
+ descriptionCn: string;
15
+ cover: string;
16
+ type: number;
17
+ machineType: string;
18
+ subscribeNum: number;
19
+ accessNum: number;
20
+ latestVersion?: string;
21
+ tags?: BohriumTag[];
22
+ authors?: BohriumAuthor[];
23
+ keywords?: string;
24
+ }
25
+ /**
26
+ * Bohrium 应用详细信息
27
+ */
28
+ export interface BohriumAppDetail extends BohriumApp {
29
+ latestDeploymentId: number;
30
+ readmeLink?: string;
31
+ readmeLinkCn?: string;
32
+ helpLink?: string;
33
+ helpLinkCn?: string;
34
+ createTime: string;
35
+ updateTime: string;
36
+ status: number;
37
+ spacePath: string;
38
+ changeLogs?: BohriumChangeLog[];
39
+ }
40
+ /**
41
+ * Bohrium 标签
42
+ */
43
+ export interface BohriumTag {
44
+ id: number;
45
+ name: string;
46
+ theme: string;
47
+ customTheme?: string;
48
+ }
49
+ /**
50
+ * Bohrium 作者信息
51
+ */
52
+ export interface BohriumAuthor {
53
+ userId: number;
54
+ userName: string;
55
+ avatarUrl?: string;
56
+ email?: string;
57
+ extId?: string;
58
+ }
59
+ /**
60
+ * Bohrium 更新日志
61
+ */
62
+ export interface BohriumChangeLog {
63
+ id: number;
64
+ version: string;
65
+ changelog: string;
66
+ createTime: string;
67
+ }
68
+ /**
69
+ * Bohrium API 响应
70
+ */
71
+ export interface BohriumApiResponse<T> {
72
+ code: number;
73
+ data: T;
74
+ message?: string;
75
+ }
76
+ /**
77
+ * Bohrium 应用列表响应
78
+ */
79
+ export interface BohriumAppListResponse {
80
+ items: BohriumApp[];
81
+ total: number;
82
+ page: number;
83
+ pageSize: number;
84
+ totalPage: number;
85
+ }
86
+ /**
87
+ * Bohrium MCP 服务配置
88
+ */
89
+ export interface BohriumMcpConfig {
90
+ mcpServers: {
91
+ [key: string]: {
92
+ url: string;
93
+ };
94
+ };
95
+ }
96
+ /**
97
+ * MCP 激活状态
98
+ */
99
+ export declare enum McpActivationStatus {
100
+ IDLE = "idle",
101
+ FETCHING_DETAIL = "fetching_detail",
102
+ ACTIVATING = "activating",
103
+ POLLING = "polling",
104
+ SUCCESS = "success",
105
+ ERROR = "error",
106
+ TIMEOUT = "timeout"
107
+ }
108
+ /**
109
+ * MCP 激活进度信息
110
+ */
111
+ export interface McpActivationProgress {
112
+ status: McpActivationStatus;
113
+ message: string;
114
+ progress: number;
115
+ deploymentId?: number;
116
+ endpoint?: {
117
+ url: string;
118
+ token: string;
119
+ };
120
+ error?: string;
121
+ retryCount?: number;
122
+ }
123
+ /**
124
+ * Bohrium 认证配置
125
+ */
126
+ export interface BohriumAuthConfig {
127
+ accessKey: string;
128
+ appKey: string;
129
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Starred Apps Local Storage Management
3
+ * 管理用户收藏的 Bohrium MCP 应用
4
+ */
5
+ export interface StarredApp {
6
+ appId: string;
7
+ appName: string;
8
+ starredAt: number;
9
+ }
10
+ /**
11
+ * 获取所有收藏的应用
12
+ */
13
+ export declare function getStarredApps(): StarredApp[];
14
+ /**
15
+ * 检查应用是否已收藏
16
+ */
17
+ export declare function isAppStarred(appId: string): boolean;
18
+ /**
19
+ * 添加应用到收藏
20
+ */
21
+ export declare function addStarredApp(appId: string, appName: string): void;
22
+ /**
23
+ * 从收藏中移除应用
24
+ */
25
+ export declare function removeStarredApp(appId: string): void;
26
+ /**
27
+ * 切换应用收藏状态
28
+ */
29
+ export declare function toggleStarredApp(appId: string, appName: string): boolean;
30
+ /**
31
+ * 获取收藏的应用 ID 列表
32
+ */
33
+ export declare function getStarredAppIds(): string[];
34
+ /**
35
+ * 清空所有收藏
36
+ */
37
+ export declare function clearStarredApps(): void;
@@ -1,9 +1,9 @@
1
- import { BuiltinMcpServer, McpServer, McpServerCreate, McpServerUpdate } from '../types/mcp';
1
+ import { McpServer, McpServerCreate, McpServerUpdate } from '../types/mcp';
2
2
  export declare const mcpService: {
3
3
  getMcpServers(): Promise<McpServer[]>;
4
4
  createMcpServer(server: McpServerCreate): Promise<McpServer>;
5
5
  updateMcpServer(id: string, server: McpServerUpdate): Promise<McpServer>;
6
6
  deleteMcpServer(id: string): Promise<void>;
7
7
  refreshMcpServers(): Promise<void>;
8
- getBuiltinMcpServers(): Promise<BuiltinMcpServer[]>;
8
+ getBuiltinMcpServers(): Promise<unknown[]>;
9
9
  };
@@ -4,10 +4,16 @@ import { XyzenState } from '../types';
4
4
  export interface AgentSlice {
5
5
  agents: Agent[];
6
6
  agentsLoading: boolean;
7
+ publishedAgents: Agent[];
8
+ publishedAgentsLoading: boolean;
9
+ officialAgents: Agent[];
10
+ officialAgentsLoading: boolean;
7
11
  hiddenGraphAgentIds: string[];
8
12
  systemAgents: Agent[];
9
13
  systemAgentsLoading: boolean;
10
14
  fetchAgents: () => Promise<void>;
15
+ fetchPublishedGraphAgents: () => Promise<void>;
16
+ fetchOfficialGraphAgents: () => Promise<void>;
11
17
  fetchSystemAgents: () => Promise<void>;
12
18
  getSystemChatAgent: () => Promise<Agent>;
13
19
  getSystemWorkshopAgent: () => Promise<Agent>;
@@ -15,6 +21,8 @@ export interface AgentSlice {
15
21
  createGraphAgent: (graphAgent: GraphAgentCreate) => Promise<void>;
16
22
  updateAgent: (agent: Agent) => Promise<void>;
17
23
  updateAgentProvider: (agentId: string, providerId: string | null) => Promise<void>;
24
+ toggleGraphAgentPublish: (agentId: string) => Promise<void>;
25
+ setGraphAgentPublish: (agentId: string, isPublished: boolean) => Promise<void>;
18
26
  deleteAgent: (id: string) => Promise<void>;
19
27
  removeGraphAgentFromSidebar: (id: string) => void;
20
28
  addGraphAgentToSidebar: (id: string) => void;
@@ -26,6 +34,7 @@ export interface GraphAgentCreate {
26
34
  name: string;
27
35
  description: string;
28
36
  state_schema?: Record<string, unknown>;
37
+ is_published?: boolean;
29
38
  }
30
39
  export declare const createAgentSlice: StateCreator<XyzenState, [
31
40
  ["zustand/immer", never]
@@ -1,9 +1,9 @@
1
- import { BuiltinMcpServer, McpServer, McpServerCreate, McpServerUpdate } from '../../types/mcp';
1
+ import { BuiltinMcpData, ExplorableMcpServer, McpServer, McpServerCreate, McpServerUpdate } from '../../types/mcp';
2
2
  import { StateCreator } from 'zustand';
3
3
  import { XyzenState } from '../types';
4
4
  export interface McpSlice {
5
5
  mcpServers: McpServer[];
6
- builtinMcpServers: BuiltinMcpServer[];
6
+ builtinMcpServers: ExplorableMcpServer<BuiltinMcpData>[];
7
7
  lastFetchTime: number;
8
8
  isEditMcpServerModalOpen: boolean;
9
9
  editingMcpServer: McpServer | null;
@@ -11,7 +11,7 @@ export interface McpSlice {
11
11
  fetchBuiltinMcpServers: () => Promise<void>;
12
12
  refreshMcpServers: () => Promise<void>;
13
13
  addMcpServer: (server: McpServerCreate) => Promise<void>;
14
- quickAddBuiltinServer: (server: BuiltinMcpServer) => Promise<void>;
14
+ quickAddBuiltinServer: (server: ExplorableMcpServer<BuiltinMcpData>) => Promise<void>;
15
15
  editMcpServer: (id: string, server: McpServerUpdate) => Promise<void>;
16
16
  removeMcpServer: (id: string) => Promise<void>;
17
17
  updateMcpServerInList: (server: McpServer) => void;
@@ -11,14 +11,54 @@ export interface McpServer {
11
11
  }[];
12
12
  user_id: string;
13
13
  }
14
- export interface BuiltinMcpServer {
14
+ /**
15
+ * 内置 MCP Server 数据
16
+ */
17
+ export interface BuiltinMcpData {
15
18
  name: string;
16
19
  module_name: string;
17
20
  mount_path: string;
18
21
  description: string;
19
- is_builtin: boolean;
22
+ is_builtin: true;
20
23
  requires_auth: boolean;
21
24
  is_default?: boolean;
25
+ banner?: string;
22
26
  }
27
+ /**
28
+ * Bohrium MCP Server 数据
29
+ */
30
+ export interface BohriumMcpData {
31
+ id: number;
32
+ appKey: string;
33
+ appUuid: string;
34
+ title: string;
35
+ description: string;
36
+ descriptionCn: string;
37
+ cover: string;
38
+ type: number;
39
+ subscribeNum: number;
40
+ accessNum: number;
41
+ tags?: Array<{
42
+ id: number;
43
+ name: string;
44
+ theme: string;
45
+ }>;
46
+ latestDeploymentId?: number;
47
+ }
48
+ /**
49
+ * 可探索的 MCP Server(统一类型)
50
+ */
51
+ export interface ExplorableMcpServer<T = BuiltinMcpData | BohriumMcpData> {
52
+ id: string;
53
+ name: string;
54
+ description: string;
55
+ source: "official" | "bohrium" | string;
56
+ cover?: string;
57
+ data: T;
58
+ }
59
+ export declare function isBuiltinMcp(server: ExplorableMcpServer): server is ExplorableMcpServer<BuiltinMcpData>;
60
+ export declare function isBohriumMcp(server: ExplorableMcpServer): server is ExplorableMcpServer<BohriumMcpData>;
61
+ /** @deprecated Use ExplorableMcpServer instead */
62
+ export type BuiltinMcpServer = ExplorableMcpServer<BuiltinMcpData>;
23
63
  export type McpServerCreate = Omit<McpServer, "id" | "status" | "tools" | "user_id">;
24
64
  export type McpServerUpdate = Partial<Omit<McpServer, "id" | "tools" | "user_id">>;
@@ -0,0 +1,32 @@
1
+ import { BohriumApp } from '../marketplace/types/bohrium';
2
+ import { BohriumMcpData, BuiltinMcpData, ExplorableMcpServer } from '../types/mcp';
3
+ interface LegacyBuiltinServer {
4
+ name: string;
5
+ module_name: string;
6
+ mount_path: string;
7
+ description: string;
8
+ requires_auth?: boolean;
9
+ is_default?: boolean;
10
+ banner?: string;
11
+ data?: unknown;
12
+ source?: string;
13
+ }
14
+ /**
15
+ * 将旧格式的 builtin server 数据转换为新的 ExplorableMcpServer 格式
16
+ * 兼容后端可能返回的多种格式
17
+ */
18
+ export declare function convertToExplorableMcpServer(server: LegacyBuiltinServer | ExplorableMcpServer<BuiltinMcpData>): ExplorableMcpServer<BuiltinMcpData>;
19
+ /**
20
+ * 将 Bohrium App 转换为 ExplorableMcpServer 格式
21
+ */
22
+ export declare function convertBohriumAppToMcpServer(app: BohriumApp): ExplorableMcpServer<BohriumMcpData>;
23
+ /**
24
+ * 批量转换 builtin servers
25
+ * 接受 unknown 类型以便从后端 API 直接使用
26
+ */
27
+ export declare function convertBuiltinServers(servers: unknown): ExplorableMcpServer<BuiltinMcpData>[];
28
+ /**
29
+ * 批量转换 Bohrium apps
30
+ */
31
+ export declare function convertBohriumApps(apps: BohriumApp[]): ExplorableMcpServer<BohriumMcpData>[];
32
+ export {};