@seastudio/sdk 3.0.2 → 3.0.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/bin/seastudio.js +0 -0
- package/dist/chunk-D7ONFXVY.js +98 -0
- package/dist/chunk-EIOFZMTC.cjs +109 -0
- package/dist/develop-tool/cli/index.cjs +79 -7
- package/dist/develop-tool/cli/index.js +79 -7
- package/dist/index.cjs +39 -189
- package/dist/index.d.cts +2 -7
- package/dist/index.d.ts +2 -7
- package/dist/index.js +1 -7
- package/dist/mcp/core/index.d.cts +2 -2
- package/dist/mcp/core/index.d.ts +2 -2
- package/dist/mcp/index.cjs +11 -161
- package/dist/mcp/index.d.cts +12 -83
- package/dist/mcp/index.d.ts +12 -83
- package/dist/mcp/index.js +1 -7
- package/dist/mcp/seastudio/index.d.cts +1 -1
- package/dist/mcp/seastudio/index.d.ts +1 -1
- package/dist/{types-B1Zqr-0Q.d.cts → types-B32sUvc0.d.cts} +9 -1
- package/dist/{types-B1Zqr-0Q.d.ts → types-B32sUvc0.d.ts} +9 -1
- package/package.json +2 -22
- package/src/develop-tool/templates/plugin/frontend/package.json.tmpl +1 -1
- package/src/develop-tool/templates/plugin/frontend/src/main.tsx +3 -0
- package/src/develop-tool/templates/plugin/frontend/src/mcp-entry.ts.tmpl +12 -0
- package/dist/chunk-4ITOR5QE.js +0 -901
- package/dist/chunk-CVF4QHS6.cjs +0 -436
- package/dist/chunk-DSOSHJH2.js +0 -643
- package/dist/chunk-FLATZQA2.js +0 -174
- package/dist/chunk-G66KY35N.js +0 -334
- package/dist/chunk-HJJTBVKQ.cjs +0 -909
- package/dist/chunk-ISI2OLPI.cjs +0 -179
- package/dist/chunk-MYURVLGP.cjs +0 -165
- package/dist/chunk-ORBVHAAS.cjs +0 -341
- package/dist/chunk-QD4KISXM.js +0 -160
- package/dist/chunk-S2UIBWKA.js +0 -99
- package/dist/chunk-SNGU4SHO.cjs +0 -654
- package/dist/chunk-XIPL7VSP.cjs +0 -110
- package/dist/chunk-Z7LV7DCO.js +0 -429
- package/dist/mcp/plugin-editor/index.cjs +0 -47
- package/dist/mcp/plugin-editor/index.d.cts +0 -98
- package/dist/mcp/plugin-editor/index.d.ts +0 -98
- package/dist/mcp/plugin-editor/index.js +0 -2
- package/dist/mcp/plugin-excel/index.cjs +0 -31
- package/dist/mcp/plugin-excel/index.d.cts +0 -86
- package/dist/mcp/plugin-excel/index.d.ts +0 -86
- package/dist/mcp/plugin-excel/index.js +0 -2
- package/dist/mcp/plugin-preview/index.cjs +0 -23
- package/dist/mcp/plugin-preview/index.d.cts +0 -109
- package/dist/mcp/plugin-preview/index.d.ts +0 -109
- package/dist/mcp/plugin-preview/index.js +0 -2
- package/dist/mcp/plugin-seaflow/index.cjs +0 -35
- package/dist/mcp/plugin-seaflow/index.d.cts +0 -318
- package/dist/mcp/plugin-seaflow/index.d.ts +0 -318
- package/dist/mcp/plugin-seaflow/index.js +0 -2
- package/dist/mcp/plugin-word/index.cjs +0 -31
- package/dist/mcp/plugin-word/index.d.cts +0 -86
- package/dist/mcp/plugin-word/index.d.ts +0 -86
- package/dist/mcp/plugin-word/index.js +0 -2
- package/dist/tools-LMW67LIY.js +0 -2
- package/dist/tools-TU7PBMDO.cjs +0 -23
package/dist/mcp/index.d.cts
CHANGED
|
@@ -1,30 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { F as FileItem, a as FileNode, J as JSONRPCError, b as JSONRPCMessage, c as JSONRPCNotification, d as JSONRPCRequest, e as JSONRPCResponse, M as MCPMessageEnvelope, f as MCPMethod, i as MCPToolCallRequest, N as NotificationHandler, P as PublishParams, S as SubscribeParams,
|
|
1
|
+
import { g as MCPTool, h as MCPToolAnnotations, j as MCPToolInputSchema } from '../types-B32sUvc0.cjs';
|
|
2
|
+
export { F as FileItem, a as FileNode, J as JSONRPCError, b as JSONRPCMessage, c as JSONRPCNotification, d as JSONRPCRequest, e as JSONRPCResponse, M as MCPMessageEnvelope, f as MCPMethod, i as MCPToolCallRequest, k as MCPToolResult, N as NotificationHandler, P as PluginMCPManifest, l as PluginMCPModuleExports, m as PublishParams, S as SubscribeParams, n as createNotification, o as createRequest, p as createResponse, q as isMCPMessage, r as isNotification } from '../types-B32sUvc0.cjs';
|
|
3
3
|
export { MCPClient, MCPClientOptions, MCPRequestOptions, MCPServer, MCPToolHandler, MCPTransport, NormalizeMCPToolInputSchemaOptions, PostMessageTransport, PostMessageTransportOptions, callHostTool, callHostToolText, createMCPClient, createMCPServer, getDefaultClient, getDefaultServer, getDefaultTransport, normalizeMCPTool, normalizeMCPToolInputSchema, normalizeMCPToolObjectSchema, setDefaultClient, setDefaultTransport, startDefaultServer } from './core/index.cjs';
|
|
4
4
|
export { FileModifiedParams, FileOpenRequestedParams, FileSavedParams, FileSendRequestedParams, FilesChangedParams, RootsChangedParams, SeastudioDragDropParams, SeastudioDragEnterParams, SeastudioDragFileData, SeastudioDragRootId, SeastudioDragStartParams, SeastudioFileDownloadOptions, SeastudioFileTreeOptions, SeastudioNotifications, SeastudioRequests, TextSendRequestedParams, agentManagementTools, agentTabTools, batchFileTools, clipboardTools, codeQualityTools, fileTools, gitTools, pluginManagementTools, pluginTabTools, seastudio, allTools as seastudioAllTools, tools as seastudioTools, shellTools } from './seastudio/index.cjs';
|
|
5
|
-
export { CodeSearchMatch, CodeSearchResult, EditorFileInfo, LintResult, TestResult, TypecheckResult, editor, allTools as editorAllTools, extensionTools as editorExtensionTools, fileMutationTools as editorFileMutationTools, previewTools as editorPreviewTools, proposalTools as editorProposalTools, referenceTools as editorReferenceTools, sessionTools as editorSessionTools, tools as editorTools, fileOperationTools } from './plugin-editor/index.cjs';
|
|
6
|
-
export { PreviewBatchEntry, PreviewBatchGetResponse, PreviewBatchItem, PreviewBatchResult, PreviewCapability, PreviewCompareVersionsResult, PreviewGetResponse, PreviewMetadata, PreviewMode, PreviewThumbnail, RenderKind, preview, coreTools as previewCoreTools, enhancedTools as previewEnhancedTools, tools as previewTools } from './plugin-preview/index.cjs';
|
|
7
|
-
export { CanvasBatchApplyResult, CanvasEdgeListItem, CanvasEdgeListResult, CanvasExecutionAuthSnapshot, CanvasExecutionAuthState, CanvasExecutionPersistMode, CanvasExecutionTaskState, CanvasNodeDetailResult, CanvasNodeOutputsResult, CanvasNodeValidationResult, CanvasTaskListItem, CanvasTaskListResult, CanvasTaskStatus, CanvasTaskWaitResult, seaflow, allTools as seaflowAllTools, canvasAuthTools as seaflowCanvasAuthTools, canvasContextTools as seaflowCanvasContextTools, canvasExecutionTools as seaflowCanvasExecutionTools, tools as seaflowTools } from './plugin-seaflow/index.cjs';
|
|
8
|
-
export { ExcelContext, ExcelFindMatch, ExcelSelectionInfo, ExcelSheetInfo, ExcelStats, excel, allTools as excelAllTools, lifecycleTools as excelLifecycleTools, mutateTools as excelMutateTools, readTools as excelReadTools, tools as excelTools } from './plugin-excel/index.cjs';
|
|
9
|
-
export { WordBlockInfo, WordContentResult, WordContext, WordFindMatch, WordSelectionInfo, word, allTools as wordAllTools, lifecycleTools as wordLifecycleTools, mutateTools as wordMutateTools, readTools as wordReadTools, tools as wordTools } from './plugin-word/index.cjs';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Shell Plugin MCP Tools
|
|
13
|
-
*
|
|
14
|
-
* Shell 插件提供的 MCP Tools
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
declare const sessionTools: MCPTool[];
|
|
18
|
-
declare const commandTools: MCPTool[];
|
|
19
|
-
declare const tools: MCPTool[];
|
|
20
|
-
declare const shellPlugin: {
|
|
21
|
-
getSession: () => Promise<MCPToolResult>;
|
|
22
|
-
getEntries: (limit?: number) => Promise<MCPToolResult>;
|
|
23
|
-
runCommand: (command: string, cwd?: string, timeout?: number) => Promise<MCPToolResult>;
|
|
24
|
-
setCwd: (cwd: string) => Promise<MCPToolResult>;
|
|
25
|
-
clearOutput: () => Promise<MCPToolResult>;
|
|
26
|
-
resetSession: () => Promise<MCPToolResult>;
|
|
27
|
-
};
|
|
28
5
|
|
|
29
6
|
/**
|
|
30
7
|
* MCP Module Entry
|
|
@@ -34,55 +11,19 @@ declare const shellPlugin: {
|
|
|
34
11
|
|
|
35
12
|
declare function loadPlugin(pluginName: string): Promise<unknown>;
|
|
36
13
|
|
|
37
|
-
/**
|
|
38
|
-
* MCP 包定义
|
|
39
|
-
*/
|
|
40
14
|
declare const MCP_PACKAGES: readonly [{
|
|
41
15
|
readonly id: "seastudio";
|
|
42
16
|
readonly name: "SeaStudio";
|
|
43
17
|
readonly description: "文件/Shell/Git 基础能力";
|
|
44
18
|
readonly tools: MCPTool[];
|
|
45
|
-
}, {
|
|
46
|
-
readonly id: "codeEditor";
|
|
47
|
-
readonly name: "Code Editor";
|
|
48
|
-
readonly description: "代码编辑器能力";
|
|
49
|
-
readonly tools: MCPTool[];
|
|
50
|
-
}, {
|
|
51
|
-
readonly id: "preview";
|
|
52
|
-
readonly name: "Preview";
|
|
53
|
-
readonly description: "预览器能力";
|
|
54
|
-
readonly tools: MCPTool[];
|
|
55
|
-
}, {
|
|
56
|
-
readonly id: "seaflow";
|
|
57
|
-
readonly name: "SeaFlow";
|
|
58
|
-
readonly description: "流程画布执行与编排能力";
|
|
59
|
-
readonly tools: MCPTool[];
|
|
60
|
-
}, {
|
|
61
|
-
readonly id: "shell";
|
|
62
|
-
readonly name: "Shell";
|
|
63
|
-
readonly description: "Shell 会话与命令执行能力";
|
|
64
|
-
readonly tools: MCPTool[];
|
|
65
|
-
}, {
|
|
66
|
-
readonly id: "excel";
|
|
67
|
-
readonly name: "Excel";
|
|
68
|
-
readonly description: "Excel 电子表格操作能力";
|
|
69
|
-
readonly tools: MCPTool[];
|
|
70
|
-
}, {
|
|
71
|
-
readonly id: "word";
|
|
72
|
-
readonly name: "Word";
|
|
73
|
-
readonly description: "Word 文档编辑能力";
|
|
74
|
-
readonly tools: MCPTool[];
|
|
75
19
|
}];
|
|
76
|
-
type MCPPackageId =
|
|
20
|
+
type MCPPackageId = string;
|
|
77
21
|
interface MCPPackageInfo {
|
|
78
22
|
id: MCPPackageId;
|
|
79
23
|
name: string;
|
|
80
24
|
description: string;
|
|
81
25
|
toolCount: number;
|
|
82
26
|
}
|
|
83
|
-
/**
|
|
84
|
-
* OpenAI function 格式的工具定义
|
|
85
|
-
*/
|
|
86
27
|
type MCPToolCapabilityRisk = 'low' | 'medium' | 'high';
|
|
87
28
|
interface MCPToolCapabilityMetadata {
|
|
88
29
|
id: string;
|
|
@@ -102,28 +43,16 @@ interface OpenAITool {
|
|
|
102
43
|
outputSchema?: MCPToolInputSchema;
|
|
103
44
|
};
|
|
104
45
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
46
|
+
interface MCPAvailableTool extends MCPTool {
|
|
47
|
+
source: string;
|
|
48
|
+
}
|
|
108
49
|
declare function mcpToolToOpenAI(tool: MCPTool): OpenAITool;
|
|
109
|
-
/**
|
|
110
|
-
* 获取所有 MCP Tools
|
|
111
|
-
*/
|
|
112
50
|
declare function listAllTools(): MCPTool[];
|
|
113
|
-
/**
|
|
114
|
-
* @deprecated 使用 listAllTools() 替代
|
|
115
|
-
*/
|
|
116
|
-
declare const listAvailableTools: typeof listAllTools;
|
|
117
51
|
declare function getMCPToolPackageIndex(): Map<string, MCPPackageId>;
|
|
118
|
-
declare function
|
|
119
|
-
declare function
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
declare function getMCPPackages(): MCPPackageInfo[];
|
|
124
|
-
/**
|
|
125
|
-
* 根据启用的包获取工具列表(OpenAI 格式)
|
|
126
|
-
*/
|
|
127
|
-
declare function getToolsForLLM(disabledPackages: Set<MCPPackageId>): OpenAITool[];
|
|
52
|
+
declare function listAvailableTools(): Promise<MCPAvailableTool[]>;
|
|
53
|
+
declare function getMCPPackageIdForTool(toolName: string): Promise<MCPPackageId | null>;
|
|
54
|
+
declare function listAvailableToolsForLLM(): Promise<OpenAITool[]>;
|
|
55
|
+
declare function getMCPPackages(): Promise<MCPPackageInfo[]>;
|
|
56
|
+
declare function getToolsForLLM(disabledPackages: Set<MCPPackageId>): Promise<OpenAITool[]>;
|
|
128
57
|
|
|
129
|
-
export { type MCPPackageId, type MCPPackageInfo, MCPTool, MCPToolAnnotations, type MCPToolCapabilityMetadata, type MCPToolCapabilityRisk, MCPToolInputSchema,
|
|
58
|
+
export { type MCPAvailableTool, type MCPPackageId, type MCPPackageInfo, MCPTool, MCPToolAnnotations, type MCPToolCapabilityMetadata, type MCPToolCapabilityRisk, MCPToolInputSchema, MCP_PACKAGES, type OpenAITool, getMCPPackageIdForTool, getMCPPackages, getMCPToolPackageIndex, getToolsForLLM, listAllTools, listAvailableTools, listAvailableToolsForLLM, loadPlugin, mcpToolToOpenAI };
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,30 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { F as FileItem, a as FileNode, J as JSONRPCError, b as JSONRPCMessage, c as JSONRPCNotification, d as JSONRPCRequest, e as JSONRPCResponse, M as MCPMessageEnvelope, f as MCPMethod, i as MCPToolCallRequest, N as NotificationHandler, P as PublishParams, S as SubscribeParams,
|
|
1
|
+
import { g as MCPTool, h as MCPToolAnnotations, j as MCPToolInputSchema } from '../types-B32sUvc0.js';
|
|
2
|
+
export { F as FileItem, a as FileNode, J as JSONRPCError, b as JSONRPCMessage, c as JSONRPCNotification, d as JSONRPCRequest, e as JSONRPCResponse, M as MCPMessageEnvelope, f as MCPMethod, i as MCPToolCallRequest, k as MCPToolResult, N as NotificationHandler, P as PluginMCPManifest, l as PluginMCPModuleExports, m as PublishParams, S as SubscribeParams, n as createNotification, o as createRequest, p as createResponse, q as isMCPMessage, r as isNotification } from '../types-B32sUvc0.js';
|
|
3
3
|
export { MCPClient, MCPClientOptions, MCPRequestOptions, MCPServer, MCPToolHandler, MCPTransport, NormalizeMCPToolInputSchemaOptions, PostMessageTransport, PostMessageTransportOptions, callHostTool, callHostToolText, createMCPClient, createMCPServer, getDefaultClient, getDefaultServer, getDefaultTransport, normalizeMCPTool, normalizeMCPToolInputSchema, normalizeMCPToolObjectSchema, setDefaultClient, setDefaultTransport, startDefaultServer } from './core/index.js';
|
|
4
4
|
export { FileModifiedParams, FileOpenRequestedParams, FileSavedParams, FileSendRequestedParams, FilesChangedParams, RootsChangedParams, SeastudioDragDropParams, SeastudioDragEnterParams, SeastudioDragFileData, SeastudioDragRootId, SeastudioDragStartParams, SeastudioFileDownloadOptions, SeastudioFileTreeOptions, SeastudioNotifications, SeastudioRequests, TextSendRequestedParams, agentManagementTools, agentTabTools, batchFileTools, clipboardTools, codeQualityTools, fileTools, gitTools, pluginManagementTools, pluginTabTools, seastudio, allTools as seastudioAllTools, tools as seastudioTools, shellTools } from './seastudio/index.js';
|
|
5
|
-
export { CodeSearchMatch, CodeSearchResult, EditorFileInfo, LintResult, TestResult, TypecheckResult, editor, allTools as editorAllTools, extensionTools as editorExtensionTools, fileMutationTools as editorFileMutationTools, previewTools as editorPreviewTools, proposalTools as editorProposalTools, referenceTools as editorReferenceTools, sessionTools as editorSessionTools, tools as editorTools, fileOperationTools } from './plugin-editor/index.js';
|
|
6
|
-
export { PreviewBatchEntry, PreviewBatchGetResponse, PreviewBatchItem, PreviewBatchResult, PreviewCapability, PreviewCompareVersionsResult, PreviewGetResponse, PreviewMetadata, PreviewMode, PreviewThumbnail, RenderKind, preview, coreTools as previewCoreTools, enhancedTools as previewEnhancedTools, tools as previewTools } from './plugin-preview/index.js';
|
|
7
|
-
export { CanvasBatchApplyResult, CanvasEdgeListItem, CanvasEdgeListResult, CanvasExecutionAuthSnapshot, CanvasExecutionAuthState, CanvasExecutionPersistMode, CanvasExecutionTaskState, CanvasNodeDetailResult, CanvasNodeOutputsResult, CanvasNodeValidationResult, CanvasTaskListItem, CanvasTaskListResult, CanvasTaskStatus, CanvasTaskWaitResult, seaflow, allTools as seaflowAllTools, canvasAuthTools as seaflowCanvasAuthTools, canvasContextTools as seaflowCanvasContextTools, canvasExecutionTools as seaflowCanvasExecutionTools, tools as seaflowTools } from './plugin-seaflow/index.js';
|
|
8
|
-
export { ExcelContext, ExcelFindMatch, ExcelSelectionInfo, ExcelSheetInfo, ExcelStats, excel, allTools as excelAllTools, lifecycleTools as excelLifecycleTools, mutateTools as excelMutateTools, readTools as excelReadTools, tools as excelTools } from './plugin-excel/index.js';
|
|
9
|
-
export { WordBlockInfo, WordContentResult, WordContext, WordFindMatch, WordSelectionInfo, word, allTools as wordAllTools, lifecycleTools as wordLifecycleTools, mutateTools as wordMutateTools, readTools as wordReadTools, tools as wordTools } from './plugin-word/index.js';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Shell Plugin MCP Tools
|
|
13
|
-
*
|
|
14
|
-
* Shell 插件提供的 MCP Tools
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
declare const sessionTools: MCPTool[];
|
|
18
|
-
declare const commandTools: MCPTool[];
|
|
19
|
-
declare const tools: MCPTool[];
|
|
20
|
-
declare const shellPlugin: {
|
|
21
|
-
getSession: () => Promise<MCPToolResult>;
|
|
22
|
-
getEntries: (limit?: number) => Promise<MCPToolResult>;
|
|
23
|
-
runCommand: (command: string, cwd?: string, timeout?: number) => Promise<MCPToolResult>;
|
|
24
|
-
setCwd: (cwd: string) => Promise<MCPToolResult>;
|
|
25
|
-
clearOutput: () => Promise<MCPToolResult>;
|
|
26
|
-
resetSession: () => Promise<MCPToolResult>;
|
|
27
|
-
};
|
|
28
5
|
|
|
29
6
|
/**
|
|
30
7
|
* MCP Module Entry
|
|
@@ -34,55 +11,19 @@ declare const shellPlugin: {
|
|
|
34
11
|
|
|
35
12
|
declare function loadPlugin(pluginName: string): Promise<unknown>;
|
|
36
13
|
|
|
37
|
-
/**
|
|
38
|
-
* MCP 包定义
|
|
39
|
-
*/
|
|
40
14
|
declare const MCP_PACKAGES: readonly [{
|
|
41
15
|
readonly id: "seastudio";
|
|
42
16
|
readonly name: "SeaStudio";
|
|
43
17
|
readonly description: "文件/Shell/Git 基础能力";
|
|
44
18
|
readonly tools: MCPTool[];
|
|
45
|
-
}, {
|
|
46
|
-
readonly id: "codeEditor";
|
|
47
|
-
readonly name: "Code Editor";
|
|
48
|
-
readonly description: "代码编辑器能力";
|
|
49
|
-
readonly tools: MCPTool[];
|
|
50
|
-
}, {
|
|
51
|
-
readonly id: "preview";
|
|
52
|
-
readonly name: "Preview";
|
|
53
|
-
readonly description: "预览器能力";
|
|
54
|
-
readonly tools: MCPTool[];
|
|
55
|
-
}, {
|
|
56
|
-
readonly id: "seaflow";
|
|
57
|
-
readonly name: "SeaFlow";
|
|
58
|
-
readonly description: "流程画布执行与编排能力";
|
|
59
|
-
readonly tools: MCPTool[];
|
|
60
|
-
}, {
|
|
61
|
-
readonly id: "shell";
|
|
62
|
-
readonly name: "Shell";
|
|
63
|
-
readonly description: "Shell 会话与命令执行能力";
|
|
64
|
-
readonly tools: MCPTool[];
|
|
65
|
-
}, {
|
|
66
|
-
readonly id: "excel";
|
|
67
|
-
readonly name: "Excel";
|
|
68
|
-
readonly description: "Excel 电子表格操作能力";
|
|
69
|
-
readonly tools: MCPTool[];
|
|
70
|
-
}, {
|
|
71
|
-
readonly id: "word";
|
|
72
|
-
readonly name: "Word";
|
|
73
|
-
readonly description: "Word 文档编辑能力";
|
|
74
|
-
readonly tools: MCPTool[];
|
|
75
19
|
}];
|
|
76
|
-
type MCPPackageId =
|
|
20
|
+
type MCPPackageId = string;
|
|
77
21
|
interface MCPPackageInfo {
|
|
78
22
|
id: MCPPackageId;
|
|
79
23
|
name: string;
|
|
80
24
|
description: string;
|
|
81
25
|
toolCount: number;
|
|
82
26
|
}
|
|
83
|
-
/**
|
|
84
|
-
* OpenAI function 格式的工具定义
|
|
85
|
-
*/
|
|
86
27
|
type MCPToolCapabilityRisk = 'low' | 'medium' | 'high';
|
|
87
28
|
interface MCPToolCapabilityMetadata {
|
|
88
29
|
id: string;
|
|
@@ -102,28 +43,16 @@ interface OpenAITool {
|
|
|
102
43
|
outputSchema?: MCPToolInputSchema;
|
|
103
44
|
};
|
|
104
45
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
46
|
+
interface MCPAvailableTool extends MCPTool {
|
|
47
|
+
source: string;
|
|
48
|
+
}
|
|
108
49
|
declare function mcpToolToOpenAI(tool: MCPTool): OpenAITool;
|
|
109
|
-
/**
|
|
110
|
-
* 获取所有 MCP Tools
|
|
111
|
-
*/
|
|
112
50
|
declare function listAllTools(): MCPTool[];
|
|
113
|
-
/**
|
|
114
|
-
* @deprecated 使用 listAllTools() 替代
|
|
115
|
-
*/
|
|
116
|
-
declare const listAvailableTools: typeof listAllTools;
|
|
117
51
|
declare function getMCPToolPackageIndex(): Map<string, MCPPackageId>;
|
|
118
|
-
declare function
|
|
119
|
-
declare function
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
declare function getMCPPackages(): MCPPackageInfo[];
|
|
124
|
-
/**
|
|
125
|
-
* 根据启用的包获取工具列表(OpenAI 格式)
|
|
126
|
-
*/
|
|
127
|
-
declare function getToolsForLLM(disabledPackages: Set<MCPPackageId>): OpenAITool[];
|
|
52
|
+
declare function listAvailableTools(): Promise<MCPAvailableTool[]>;
|
|
53
|
+
declare function getMCPPackageIdForTool(toolName: string): Promise<MCPPackageId | null>;
|
|
54
|
+
declare function listAvailableToolsForLLM(): Promise<OpenAITool[]>;
|
|
55
|
+
declare function getMCPPackages(): Promise<MCPPackageInfo[]>;
|
|
56
|
+
declare function getToolsForLLM(disabledPackages: Set<MCPPackageId>): Promise<OpenAITool[]>;
|
|
128
57
|
|
|
129
|
-
export { type MCPPackageId, type MCPPackageInfo, MCPTool, MCPToolAnnotations, type MCPToolCapabilityMetadata, type MCPToolCapabilityRisk, MCPToolInputSchema,
|
|
58
|
+
export { type MCPAvailableTool, type MCPPackageId, type MCPPackageInfo, MCPTool, MCPToolAnnotations, type MCPToolCapabilityMetadata, type MCPToolCapabilityRisk, MCPToolInputSchema, MCP_PACKAGES, type OpenAITool, getMCPPackageIdForTool, getMCPPackages, getMCPToolPackageIndex, getToolsForLLM, listAllTools, listAvailableTools, listAvailableToolsForLLM, loadPlugin, mcpToolToOpenAI };
|
package/dist/mcp/index.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
export { MCP_PACKAGES, getMCPPackageIdForTool, getMCPPackages, getMCPToolPackageIndex, getToolsForLLM, listAllTools, listAvailableTools, listAvailableToolsForLLM, loadPlugin, mcpToolToOpenAI } from '../chunk-
|
|
2
|
-
export { word, allTools as wordAllTools, lifecycleTools as wordLifecycleTools, mutateTools as wordMutateTools, readTools as wordReadTools, tools as wordTools } from '../chunk-G66KY35N.js';
|
|
3
|
-
export { seaflow, allTools as seaflowAllTools, canvasAuthTools as seaflowCanvasAuthTools, canvasContextTools as seaflowCanvasContextTools, canvasExecutionTools as seaflowCanvasExecutionTools, tools as seaflowTools } from '../chunk-4ITOR5QE.js';
|
|
1
|
+
export { MCP_PACKAGES, getMCPPackageIdForTool, getMCPPackages, getMCPToolPackageIndex, getToolsForLLM, listAllTools, listAvailableTools, listAvailableToolsForLLM, loadPlugin, mcpToolToOpenAI } from '../chunk-D7ONFXVY.js';
|
|
4
2
|
export { SeastudioNotifications, SeastudioRequests, agentManagementTools, agentTabTools, batchFileTools, clipboardTools, codeQualityTools, fileTools, gitTools, pluginManagementTools, pluginTabTools, seastudio, allTools as seastudioAllTools, tools as seastudioTools, shellTools } from '../chunk-XU5GEWWL.js';
|
|
5
|
-
export { shellPlugin, commandTools as shellPluginCommandTools, sessionTools as shellPluginSessionTools, tools as shellPluginTools } from '../chunk-FLATZQA2.js';
|
|
6
|
-
export { excel, allTools as excelAllTools, lifecycleTools as excelLifecycleTools, mutateTools as excelMutateTools, readTools as excelReadTools, tools as excelTools } from '../chunk-Z7LV7DCO.js';
|
|
7
|
-
export { preview, coreTools as previewCoreTools, enhancedTools as previewEnhancedTools, tools as previewTools } from '../chunk-QD4KISXM.js';
|
|
8
|
-
export { editor, allTools as editorAllTools, extensionTools as editorExtensionTools, fileMutationTools as editorFileMutationTools, previewTools as editorPreviewTools, proposalTools as editorProposalTools, referenceTools as editorReferenceTools, sessionTools as editorSessionTools, tools as editorTools, fileOperationTools } from '../chunk-DSOSHJH2.js';
|
|
9
3
|
export { MCPClient, MCPServer, PostMessageTransport, callHostTool, callHostToolText, createMCPClient, createMCPServer, createNotification, createRequest, createResponse, getDefaultClient, getDefaultServer, getDefaultTransport, isMCPMessage, isNotification, normalizeMCPTool, normalizeMCPToolInputSchema, normalizeMCPToolObjectSchema, setDefaultClient, setDefaultTransport, startDefaultServer } from '../chunk-ANWOL7SM.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as MCPTool, k as MCPToolResult, h as MCPToolAnnotations, j as MCPToolInputSchema } from '../../types-
|
|
1
|
+
import { g as MCPTool, k as MCPToolResult, h as MCPToolAnnotations, j as MCPToolInputSchema } from '../../types-B32sUvc0.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Plugin MCP Tools
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as MCPTool, k as MCPToolResult, h as MCPToolAnnotations, j as MCPToolInputSchema } from '../../types-
|
|
1
|
+
import { g as MCPTool, k as MCPToolResult, h as MCPToolAnnotations, j as MCPToolInputSchema } from '../../types-B32sUvc0.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Plugin MCP Tools
|
|
@@ -56,6 +56,14 @@ interface MCPTool {
|
|
|
56
56
|
outputSchema?: MCPToolInputSchema;
|
|
57
57
|
annotations?: MCPToolAnnotations;
|
|
58
58
|
}
|
|
59
|
+
interface PluginMCPManifest {
|
|
60
|
+
schemaVersion: 1;
|
|
61
|
+
tools: MCPTool[];
|
|
62
|
+
}
|
|
63
|
+
interface PluginMCPModuleExports {
|
|
64
|
+
pluginMcpManifest?: PluginMCPManifest;
|
|
65
|
+
mcpTools?: MCPTool[];
|
|
66
|
+
}
|
|
59
67
|
interface MCPToolResult {
|
|
60
68
|
content: Array<{
|
|
61
69
|
type: 'text' | 'image' | 'resource';
|
|
@@ -104,4 +112,4 @@ declare function createRequest(method: string, params?: Record<string, unknown>)
|
|
|
104
112
|
declare function createResponse(id: string | number, result?: unknown, error?: JSONRPCError): JSONRPCResponse;
|
|
105
113
|
declare function createNotification(method: string, params?: Record<string, unknown>): JSONRPCNotification;
|
|
106
114
|
|
|
107
|
-
export { type FileItem as F, type JSONRPCError as J, type MCPMessageEnvelope as M, type NotificationHandler as N, type
|
|
115
|
+
export { type FileItem as F, type JSONRPCError as J, type MCPMessageEnvelope as M, type NotificationHandler as N, type PluginMCPManifest as P, type SubscribeParams as S, type FileNode as a, type JSONRPCMessage as b, type JSONRPCNotification as c, type JSONRPCRequest as d, type JSONRPCResponse as e, type MCPMethod as f, type MCPTool as g, type MCPToolAnnotations as h, type MCPToolCallRequest as i, type MCPToolInputSchema as j, type MCPToolResult as k, type PluginMCPModuleExports as l, type PublishParams as m, createNotification as n, createRequest as o, createResponse as p, isMCPMessage as q, isNotification as r };
|
|
@@ -56,6 +56,14 @@ interface MCPTool {
|
|
|
56
56
|
outputSchema?: MCPToolInputSchema;
|
|
57
57
|
annotations?: MCPToolAnnotations;
|
|
58
58
|
}
|
|
59
|
+
interface PluginMCPManifest {
|
|
60
|
+
schemaVersion: 1;
|
|
61
|
+
tools: MCPTool[];
|
|
62
|
+
}
|
|
63
|
+
interface PluginMCPModuleExports {
|
|
64
|
+
pluginMcpManifest?: PluginMCPManifest;
|
|
65
|
+
mcpTools?: MCPTool[];
|
|
66
|
+
}
|
|
59
67
|
interface MCPToolResult {
|
|
60
68
|
content: Array<{
|
|
61
69
|
type: 'text' | 'image' | 'resource';
|
|
@@ -104,4 +112,4 @@ declare function createRequest(method: string, params?: Record<string, unknown>)
|
|
|
104
112
|
declare function createResponse(id: string | number, result?: unknown, error?: JSONRPCError): JSONRPCResponse;
|
|
105
113
|
declare function createNotification(method: string, params?: Record<string, unknown>): JSONRPCNotification;
|
|
106
114
|
|
|
107
|
-
export { type FileItem as F, type JSONRPCError as J, type MCPMessageEnvelope as M, type NotificationHandler as N, type
|
|
115
|
+
export { type FileItem as F, type JSONRPCError as J, type MCPMessageEnvelope as M, type NotificationHandler as N, type PluginMCPManifest as P, type SubscribeParams as S, type FileNode as a, type JSONRPCMessage as b, type JSONRPCNotification as c, type JSONRPCRequest as d, type JSONRPCResponse as e, type MCPMethod as f, type MCPTool as g, type MCPToolAnnotations as h, type MCPToolCallRequest as i, type MCPToolInputSchema as j, type MCPToolResult as k, type PluginMCPModuleExports as l, type PublishParams as m, createNotification as n, createRequest as o, createResponse as p, isMCPMessage as q, isNotification as r };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seastudio/sdk",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "SeaStudio SDK - UI 组件 + MCP 信息交换中心 + CLI 工具",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -35,28 +35,8 @@
|
|
|
35
35
|
"import": "./dist/mcp/seastudio/index.js",
|
|
36
36
|
"require": "./dist/mcp/seastudio/index.cjs"
|
|
37
37
|
},
|
|
38
|
-
"./mcp/plugin-editor": {
|
|
39
|
-
"types": "./dist/mcp/plugin-editor/index.d.ts",
|
|
40
|
-
"import": "./dist/mcp/plugin-editor/index.js",
|
|
41
|
-
"require": "./dist/mcp/plugin-editor/index.cjs"
|
|
42
|
-
},
|
|
43
|
-
"./mcp/plugin-preview": {
|
|
44
|
-
"types": "./dist/mcp/plugin-preview/index.d.ts",
|
|
45
|
-
"import": "./dist/mcp/plugin-preview/index.js",
|
|
46
|
-
"require": "./dist/mcp/plugin-preview/index.cjs"
|
|
47
|
-
},
|
|
48
|
-
"./mcp/plugin-seaflow": {
|
|
49
|
-
"types": "./dist/mcp/plugin-seaflow/index.d.ts",
|
|
50
|
-
"import": "./dist/mcp/plugin-seaflow/index.js",
|
|
51
|
-
"require": "./dist/mcp/plugin-seaflow/index.cjs"
|
|
52
|
-
},
|
|
53
38
|
"./ui/cosmos.css": "./src/ui/cosmos.css",
|
|
54
|
-
"./styles/cosmos.css": "./src/ui/cosmos.css"
|
|
55
|
-
"./mcp/plugin-excel": {
|
|
56
|
-
"types": "./dist/mcp/plugin-excel/index.d.ts",
|
|
57
|
-
"import": "./dist/mcp/plugin-excel/index.js",
|
|
58
|
-
"require": "./dist/mcp/plugin-excel/index.cjs"
|
|
59
|
-
}
|
|
39
|
+
"./styles/cosmos.css": "./src/ui/cosmos.css"
|
|
60
40
|
},
|
|
61
41
|
"files": [
|
|
62
42
|
"bin",
|
|
@@ -2,6 +2,9 @@ import { StrictMode } from 'react';
|
|
|
2
2
|
import { createRoot } from 'react-dom/client';
|
|
3
3
|
import App from './App';
|
|
4
4
|
import './App.css';
|
|
5
|
+
import { initPluginMCPServer } from './mcp-entry';
|
|
6
|
+
|
|
7
|
+
initPluginMCPServer();
|
|
5
8
|
|
|
6
9
|
createRoot(document.getElementById('root')!).render(
|
|
7
10
|
<StrictMode>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MCPServer, MCPTool, PluginMCPManifest } from '@seastudio/sdk/mcp/core'
|
|
2
|
+
|
|
3
|
+
export const mcpTools: MCPTool[] = []
|
|
4
|
+
|
|
5
|
+
export const pluginMcpManifest: PluginMCPManifest = {
|
|
6
|
+
schemaVersion: 1,
|
|
7
|
+
tools: mcpTools,
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function initPluginMCPServer(_server?: MCPServer): void {
|
|
11
|
+
// 在这里初始化并注册插件自己的 MCP tools handlers。
|
|
12
|
+
}
|