@seastudio/sdk 3.0.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.
Files changed (77) hide show
  1. package/README.md +108 -0
  2. package/bin/seastudio.js +3 -0
  3. package/dist/chunk-4ITOR5QE.js +901 -0
  4. package/dist/chunk-5QAINQWV.js +94 -0
  5. package/dist/chunk-6USQFZRH.js +291 -0
  6. package/dist/chunk-AGBZJGTY.cjs +1311 -0
  7. package/dist/chunk-ANWOL7SM.js +566 -0
  8. package/dist/chunk-BWG45ZWF.cjs +305 -0
  9. package/dist/chunk-CVF4QHS6.cjs +436 -0
  10. package/dist/chunk-DDVRUPMZ.js +1293 -0
  11. package/dist/chunk-DSOSHJH2.js +643 -0
  12. package/dist/chunk-FLATZQA2.js +174 -0
  13. package/dist/chunk-HJJTBVKQ.cjs +909 -0
  14. package/dist/chunk-ISI2OLPI.cjs +179 -0
  15. package/dist/chunk-MYURVLGP.cjs +165 -0
  16. package/dist/chunk-N33Y5NY7.cjs +105 -0
  17. package/dist/chunk-QD4KISXM.js +160 -0
  18. package/dist/chunk-SNGU4SHO.cjs +654 -0
  19. package/dist/chunk-TFOJLA2F.cjs +588 -0
  20. package/dist/chunk-Z7LV7DCO.js +429 -0
  21. package/dist/develop-tool/cli/index.cjs +1138 -0
  22. package/dist/develop-tool/cli/index.d.cts +1 -0
  23. package/dist/develop-tool/cli/index.d.ts +1 -0
  24. package/dist/develop-tool/cli/index.js +1127 -0
  25. package/dist/index.cjs +370 -0
  26. package/dist/index.d.cts +11 -0
  27. package/dist/index.d.ts +11 -0
  28. package/dist/index.js +9 -0
  29. package/dist/mcp/core/index.cjs +90 -0
  30. package/dist/mcp/core/index.d.cts +124 -0
  31. package/dist/mcp/core/index.d.ts +124 -0
  32. package/dist/mcp/core/index.js +1 -0
  33. package/dist/mcp/index.cjs +317 -0
  34. package/dist/mcp/index.d.cts +123 -0
  35. package/dist/mcp/index.d.ts +123 -0
  36. package/dist/mcp/index.js +8 -0
  37. package/dist/mcp/plugin-editor/index.cjs +47 -0
  38. package/dist/mcp/plugin-editor/index.d.cts +98 -0
  39. package/dist/mcp/plugin-editor/index.d.ts +98 -0
  40. package/dist/mcp/plugin-editor/index.js +2 -0
  41. package/dist/mcp/plugin-excel/index.cjs +31 -0
  42. package/dist/mcp/plugin-excel/index.d.cts +86 -0
  43. package/dist/mcp/plugin-excel/index.d.ts +86 -0
  44. package/dist/mcp/plugin-excel/index.js +2 -0
  45. package/dist/mcp/plugin-preview/index.cjs +23 -0
  46. package/dist/mcp/plugin-preview/index.d.cts +109 -0
  47. package/dist/mcp/plugin-preview/index.d.ts +109 -0
  48. package/dist/mcp/plugin-preview/index.js +2 -0
  49. package/dist/mcp/plugin-seaflow/index.cjs +35 -0
  50. package/dist/mcp/plugin-seaflow/index.d.cts +318 -0
  51. package/dist/mcp/plugin-seaflow/index.d.ts +318 -0
  52. package/dist/mcp/plugin-seaflow/index.js +2 -0
  53. package/dist/mcp/seastudio/index.cjs +75 -0
  54. package/dist/mcp/seastudio/index.d.cts +341 -0
  55. package/dist/mcp/seastudio/index.d.ts +341 -0
  56. package/dist/mcp/seastudio/index.js +2 -0
  57. package/dist/tools-LMW67LIY.js +2 -0
  58. package/dist/tools-TU7PBMDO.cjs +23 -0
  59. package/dist/types-Clgf5gBf.d.cts +107 -0
  60. package/dist/types-Clgf5gBf.d.ts +107 -0
  61. package/dist/ui/index.cjs +58 -0
  62. package/dist/ui/index.d.cts +142 -0
  63. package/dist/ui/index.d.ts +142 -0
  64. package/dist/ui/index.js +1 -0
  65. package/package.json +115 -0
  66. package/src/develop-tool/templates/plugin/README.md.tmpl +36 -0
  67. package/src/develop-tool/templates/plugin/frontend/index.html.tmpl +12 -0
  68. package/src/develop-tool/templates/plugin/frontend/package.json.tmpl +30 -0
  69. package/src/develop-tool/templates/plugin/frontend/postcss.config.js +6 -0
  70. package/src/develop-tool/templates/plugin/frontend/src/App.css +43 -0
  71. package/src/develop-tool/templates/plugin/frontend/src/App.tsx.tmpl +43 -0
  72. package/src/develop-tool/templates/plugin/frontend/src/main.tsx +10 -0
  73. package/src/develop-tool/templates/plugin/frontend/src/vite-env.d.ts +1 -0
  74. package/src/develop-tool/templates/plugin/frontend/tsconfig.json +20 -0
  75. package/src/develop-tool/templates/plugin/frontend/vite.config.ts +12 -0
  76. package/src/develop-tool/templates/plugin/seastudio.config.json.tmpl +14 -0
  77. package/src/ui/cosmos.css +407 -0
@@ -0,0 +1,341 @@
1
+ import { g as MCPTool, k as MCPToolResult, h as MCPToolAnnotations, j as MCPToolInputSchema } from '../../types-Clgf5gBf.cjs';
2
+
3
+ /**
4
+ * Plugin MCP Tools
5
+ *
6
+ * 插件管理 + 插件标签操作
7
+ */
8
+
9
+ declare const pluginManagementTools: MCPTool[];
10
+ declare const pluginTabTools: MCPTool[];
11
+
12
+ /**
13
+ * Agent MCP Tools
14
+ *
15
+ * Agent 管理 + Agent 标签操作
16
+ */
17
+
18
+ declare const agentManagementTools: MCPTool[];
19
+ declare const agentTabTools: MCPTool[];
20
+
21
+ /**
22
+ * SeaStudio MCP Tools
23
+ *
24
+ * 主程序基础能力:file, shell, git
25
+ */
26
+
27
+ type SeastudioFilesystemRootId = 'workspace';
28
+ interface SeastudioFilesystemRoot {
29
+ id: SeastudioFilesystemRootId;
30
+ label: string;
31
+ description: string;
32
+ }
33
+ interface SeastudioFileInfo {
34
+ rootId: SeastudioFilesystemRootId;
35
+ path: string;
36
+ name: string;
37
+ type: 'file' | 'directory';
38
+ size: number;
39
+ mtime: number;
40
+ modified: number;
41
+ mime?: string;
42
+ isFile: boolean;
43
+ isDirectory: boolean;
44
+ }
45
+ interface SeastudioFileSearchMatch {
46
+ path: string;
47
+ line: number;
48
+ text: string;
49
+ }
50
+ interface SeastudioFileReadOptions {
51
+ rootId?: SeastudioFilesystemRootId;
52
+ offset?: number;
53
+ limit?: number;
54
+ }
55
+ interface SeastudioFileListOptions {
56
+ rootId?: SeastudioFilesystemRootId;
57
+ }
58
+ interface SeastudioFileTreeOptions {
59
+ rootId?: SeastudioFilesystemRootId;
60
+ depth?: number;
61
+ }
62
+ interface SeastudioFileInfoOptions {
63
+ rootId?: SeastudioFilesystemRootId;
64
+ }
65
+ interface SeastudioSinglePathOptions {
66
+ rootId?: SeastudioFilesystemRootId;
67
+ }
68
+ interface SeastudioFileDownloadOptions {
69
+ rootId?: SeastudioFilesystemRootId;
70
+ }
71
+ interface SeastudioFileSearchOptions {
72
+ rootId?: SeastudioFilesystemRootId;
73
+ path?: string;
74
+ glob?: string;
75
+ headLimit?: number;
76
+ }
77
+ type SeastudioWorkspacePathMode = 'workspace' | 'absolute';
78
+ interface SeastudioFileTransferOptions {
79
+ sourceRootId?: SeastudioFilesystemRootId;
80
+ destRootId?: SeastudioFilesystemRootId;
81
+ sourcePathMode?: SeastudioWorkspacePathMode;
82
+ destPathMode?: SeastudioWorkspacePathMode;
83
+ }
84
+ interface SeastudioBatchFlattenPreviewOptions {
85
+ sourceRootId?: SeastudioFilesystemRootId;
86
+ sourcePathMode?: SeastudioWorkspacePathMode;
87
+ }
88
+ interface SeastudioBatchFlattenCopyOptions extends SeastudioFileTransferOptions {
89
+ }
90
+ type SeastudioShellSessionEntryLevel = 'command' | 'stdout' | 'stderr' | 'meta';
91
+ interface SeastudioShellSessionEntry {
92
+ id: number;
93
+ level: SeastudioShellSessionEntryLevel;
94
+ content: string;
95
+ createdAt: number;
96
+ }
97
+ interface SeastudioShellSessionSnapshot {
98
+ projectPath: string | null;
99
+ cwd: string | null;
100
+ promptLabel: string;
101
+ isRunning: boolean;
102
+ lastExitCode: number | null;
103
+ lastDurationMs: number | null;
104
+ lastCommandAt: number | null;
105
+ historyCount: number;
106
+ entryCount: number;
107
+ }
108
+ interface SeastudioShellCommandResult {
109
+ command: string;
110
+ cwd: string;
111
+ exitCode: number;
112
+ stdout: string;
113
+ stderr: string;
114
+ error: string | null;
115
+ durationMs: number;
116
+ usedFallback: boolean;
117
+ }
118
+ declare function annotateTool(tool: MCPTool, annotations: MCPToolAnnotations, outputSchema?: MCPToolInputSchema): MCPTool;
119
+ declare const fileTools: MCPTool[];
120
+ declare const shellTools: MCPTool[];
121
+ declare const gitTools: MCPTool[];
122
+ declare const clipboardTools: MCPTool[];
123
+ declare const codeQualityTools: MCPTool[];
124
+ declare const batchFileTools: MCPTool[];
125
+ declare const seaCloudTools: MCPTool[];
126
+
127
+ declare const allTools: MCPTool[];
128
+ declare const tools: MCPTool[];
129
+ declare const seastudio: {
130
+ roots: {
131
+ list: () => Promise<{
132
+ roots: SeastudioFilesystemRoot[];
133
+ }>;
134
+ };
135
+ file: {
136
+ getSelected: () => Promise<MCPToolResult>;
137
+ read: (path: string, options?: SeastudioFileReadOptions) => Promise<MCPToolResult>;
138
+ write: (path: string, content: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
139
+ list: (path?: string, options?: SeastudioFileListOptions) => Promise<MCPToolResult>;
140
+ delete: (path: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
141
+ mkdir: (path: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
142
+ exists: (path: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
143
+ stat: (path: string, options?: SeastudioFileInfoOptions) => Promise<MCPToolResult>;
144
+ info: (path: string, options?: SeastudioFileInfoOptions) => Promise<MCPToolResult>;
145
+ search: (query: string, options?: SeastudioFileSearchOptions) => Promise<MCPToolResult>;
146
+ rename: (path: string, newName: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
147
+ move: (sourcePath: string, destDir: string, options?: SeastudioFileTransferOptions) => Promise<MCPToolResult>;
148
+ copyTo: (sourcePath: string, destDir: string, options?: SeastudioFileTransferOptions) => Promise<MCPToolResult>;
149
+ copy: (path: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
150
+ paste: (path?: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
151
+ clipboardCheck: () => Promise<MCPToolResult>;
152
+ copyPath: (path: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
153
+ trash: (path: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
154
+ batchFlattenPreview: (sourcePath: string, options?: SeastudioBatchFlattenPreviewOptions) => Promise<MCPToolResult>;
155
+ batchFlattenCopy: (sourcePath: string, destDir: string, taskId?: string, options?: SeastudioBatchFlattenCopyOptions) => Promise<MCPToolResult>;
156
+ getUrl: (path: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
157
+ download: (url: string, path: string, filenameHint?: string, options?: SeastudioFileDownloadOptions) => Promise<MCPToolResult>;
158
+ writeBinary: (path: string, base64: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
159
+ readBinary: (path: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
160
+ };
161
+ shell: {
162
+ execute: (command: string, cwd?: string, timeout?: number) => Promise<MCPToolResult>;
163
+ session: {
164
+ get: () => Promise<MCPToolResult>;
165
+ getEntries: (limit?: number) => Promise<MCPToolResult>;
166
+ runCommand: (command: string, cwd?: string, timeout?: number) => Promise<MCPToolResult>;
167
+ setCwd: (cwd: string) => Promise<MCPToolResult>;
168
+ clear: () => Promise<MCPToolResult>;
169
+ reset: () => Promise<MCPToolResult>;
170
+ };
171
+ };
172
+ git: {
173
+ status: () => Promise<MCPToolResult>;
174
+ diff: (staged?: boolean, path?: string) => Promise<MCPToolResult>;
175
+ };
176
+ codeQuality: {
177
+ runTest: (command?: string, timeout?: number) => Promise<MCPToolResult>;
178
+ runTypecheck: (command?: string, timeout?: number) => Promise<MCPToolResult>;
179
+ runLint: (command?: string, timeout?: number) => Promise<MCPToolResult>;
180
+ codeSearch: (pattern: string, path?: string, glob?: string, headLimit?: number) => Promise<MCPToolResult>;
181
+ };
182
+ };
183
+
184
+ /**
185
+ * SeaStudio MCP Notifications
186
+ *
187
+ * 主程序发布的 MCP 通知定义
188
+ *
189
+ * 架构说明:
190
+ * - 插件通过 SeastudioRequests 发送请求到主程序
191
+ * - 主程序处理请求后,通过 SeastudioNotifications 发布标准通知
192
+ * - 所有插件订阅 SeastudioNotifications 中的标准通知
193
+ */
194
+ /**
195
+ * 插件发送给主程序的请求主题
196
+ *
197
+ * 插件不应直接发布通知,而是发送请求,由主程序统一处理后发布标准通知。
198
+ *
199
+ * @example
200
+ * ```typescript
201
+ * import { getDefaultClient } from '@seastudio/sdk/mcp/core';
202
+ * import { SeastudioRequests } from '@seastudio/sdk/mcp/seastudio';
203
+ *
204
+ * const client = getDefaultClient();
205
+ * // 请求打开文件(主程序会发布 FILE_OPEN_REQUESTED 通知)
206
+ * client.publish(SeastudioRequests.FILE_OPEN, { path: '/path/to/file.ts' });
207
+ * ```
208
+ */
209
+ declare const SeastudioRequests: {
210
+ /** 请求打开文件 -> 主程序发布 FILE_OPEN_REQUESTED */
211
+ readonly FILE_OPEN: "request:file_open";
212
+ /** 请求标记文件已修改 -> 主程序发布 FILE_MODIFIED */
213
+ readonly FILE_MODIFIED: "request:file_modified";
214
+ /** 请求标记文件已保存 -> 主程序发布 FILE_SAVED */
215
+ readonly FILE_SAVED: "request:file_saved";
216
+ /** 请求发送文本给 Agent -> 主程序发布 TEXT_SEND_REQUESTED */
217
+ readonly TEXT_SEND: "request:text_send";
218
+ };
219
+ /**
220
+ * SeaStudio 主程序发布的通知主题
221
+ *
222
+ * 这些通知由主程序统一发布,插件应订阅这些通知以获取状态更新。
223
+ *
224
+ * @example
225
+ * ```typescript
226
+ * import { getDefaultServer, getDefaultClient } from '@seastudio/sdk/mcp/core';
227
+ * import { SeastudioNotifications } from '@seastudio/sdk/mcp/seastudio';
228
+ *
229
+ * // 订阅通知
230
+ * const client = getDefaultClient();
231
+ * client.subscribe([SeastudioNotifications.FILES_CHANGED]);
232
+ *
233
+ * // 处理通知
234
+ * const server = getDefaultServer();
235
+ * server.onNotification(SeastudioNotifications.FILES_CHANGED, (params) => {
236
+ * const { type, path } = params as FilesChangedParams;
237
+ * // 刷新文件树
238
+ * });
239
+ * ```
240
+ */
241
+ declare const SeastudioNotifications: {
242
+ /** 文件系统变化通知(fs.watch 触发) */
243
+ readonly FILES_CHANGED: "files:changed";
244
+ /** 根目录变化通知 */
245
+ readonly ROOTS_CHANGED: "roots:changed";
246
+ /** 文件打开请求,可广播也可定向 */
247
+ readonly FILE_OPEN_REQUESTED: "seastudio:file-open_requested";
248
+ /** 文件已修改通知(内容变化,未保存) */
249
+ readonly FILE_MODIFIED: "file:modified";
250
+ /** 文件已保存通知 */
251
+ readonly FILE_SAVED: "file:saved";
252
+ /** 文件发送请求 */
253
+ readonly FILE_SEND_REQUESTED: "seastudio:file-send_requested";
254
+ /** 文本发送请求 */
255
+ readonly TEXT_SEND_REQUESTED: "seastudio:text-send_requested";
256
+ };
257
+ /**
258
+ * files:changed 通知参数
259
+ */
260
+ interface FilesChangedParams {
261
+ /** 变化类型:project(工作区) */
262
+ type: 'project';
263
+ /** 发生变化的目录路径 */
264
+ path: string;
265
+ }
266
+ interface RootsChangedParams {
267
+ roots: Array<{
268
+ id: 'workspace';
269
+ label: string;
270
+ description: string;
271
+ }>;
272
+ }
273
+ type SeastudioDragRootId = 'workspace';
274
+ interface SeastudioDragFileData {
275
+ sourcePath: string;
276
+ sourceRootId?: SeastudioDragRootId;
277
+ sourcePlugin?: string;
278
+ sourceType: 'file' | 'directory';
279
+ sourceZone: string;
280
+ isExternal?: boolean;
281
+ }
282
+ interface SeastudioDragStartParams extends SeastudioDragFileData {
283
+ pluginId?: string;
284
+ }
285
+ interface SeastudioDragEnterParams extends SeastudioDragFileData {
286
+ }
287
+ interface SeastudioDragDropParams extends SeastudioDragFileData {
288
+ }
289
+ interface FileTransferRequestedParams {
290
+ source: 'workspace';
291
+ rootId: 'workspace';
292
+ path: string;
293
+ name: string;
294
+ kind: 'file' | 'directory';
295
+ isDirectory: boolean;
296
+ }
297
+ interface FileOpenRequestedParams extends FileTransferRequestedParams {
298
+ }
299
+ interface FileSendRequestedParams extends FileTransferRequestedParams {
300
+ }
301
+ interface TextSendRequestedSelectionRange {
302
+ startLine?: number;
303
+ startColumn?: number;
304
+ endLine?: number;
305
+ endColumn?: number;
306
+ }
307
+ interface TextSendRequestedSource {
308
+ type: 'editor' | 'plugin';
309
+ id?: string;
310
+ label?: string;
311
+ path?: string;
312
+ uri?: string;
313
+ language?: string;
314
+ selection?: TextSendRequestedSelectionRange;
315
+ }
316
+ interface TextSendRequestedParams {
317
+ source: TextSendRequestedSource;
318
+ text: string;
319
+ }
320
+ /**
321
+ * file:modified 通知参数
322
+ */
323
+ interface FileModifiedParams {
324
+ /** 文件路径 */
325
+ path: string;
326
+ /** 是否有未保存的修改 */
327
+ isDirty: boolean;
328
+ /** 触发来源插件 ID */
329
+ source?: string;
330
+ }
331
+ /**
332
+ * file:saved 通知参数
333
+ */
334
+ interface FileSavedParams {
335
+ /** 文件路径 */
336
+ path: string;
337
+ /** 触发来源插件 ID */
338
+ source?: string;
339
+ }
340
+
341
+ export { type FileModifiedParams, type FileOpenRequestedParams, type FileSavedParams, type FileSendRequestedParams, type FileTransferRequestedParams, type FilesChangedParams, type RootsChangedParams, type SeastudioBatchFlattenCopyOptions, type SeastudioBatchFlattenPreviewOptions, type SeastudioDragDropParams, type SeastudioDragEnterParams, type SeastudioDragFileData, type SeastudioDragRootId, type SeastudioDragStartParams, type SeastudioFileDownloadOptions, type SeastudioFileInfo, type SeastudioFileInfoOptions, type SeastudioFileListOptions, type SeastudioFileReadOptions, type SeastudioFileSearchMatch, type SeastudioFileSearchOptions, type SeastudioFileTransferOptions, type SeastudioFileTreeOptions, type SeastudioFilesystemRoot, type SeastudioFilesystemRootId, SeastudioNotifications, SeastudioRequests, type SeastudioShellCommandResult, type SeastudioShellSessionEntry, type SeastudioShellSessionEntryLevel, type SeastudioShellSessionSnapshot, type SeastudioSinglePathOptions, type SeastudioWorkspacePathMode, type TextSendRequestedParams, type TextSendRequestedSelectionRange, type TextSendRequestedSource, agentManagementTools, agentTabTools, allTools, annotateTool, batchFileTools, clipboardTools, codeQualityTools, fileTools, gitTools, pluginManagementTools, pluginTabTools, seaCloudTools, seastudio, shellTools, tools };
@@ -0,0 +1,341 @@
1
+ import { g as MCPTool, k as MCPToolResult, h as MCPToolAnnotations, j as MCPToolInputSchema } from '../../types-Clgf5gBf.js';
2
+
3
+ /**
4
+ * Plugin MCP Tools
5
+ *
6
+ * 插件管理 + 插件标签操作
7
+ */
8
+
9
+ declare const pluginManagementTools: MCPTool[];
10
+ declare const pluginTabTools: MCPTool[];
11
+
12
+ /**
13
+ * Agent MCP Tools
14
+ *
15
+ * Agent 管理 + Agent 标签操作
16
+ */
17
+
18
+ declare const agentManagementTools: MCPTool[];
19
+ declare const agentTabTools: MCPTool[];
20
+
21
+ /**
22
+ * SeaStudio MCP Tools
23
+ *
24
+ * 主程序基础能力:file, shell, git
25
+ */
26
+
27
+ type SeastudioFilesystemRootId = 'workspace';
28
+ interface SeastudioFilesystemRoot {
29
+ id: SeastudioFilesystemRootId;
30
+ label: string;
31
+ description: string;
32
+ }
33
+ interface SeastudioFileInfo {
34
+ rootId: SeastudioFilesystemRootId;
35
+ path: string;
36
+ name: string;
37
+ type: 'file' | 'directory';
38
+ size: number;
39
+ mtime: number;
40
+ modified: number;
41
+ mime?: string;
42
+ isFile: boolean;
43
+ isDirectory: boolean;
44
+ }
45
+ interface SeastudioFileSearchMatch {
46
+ path: string;
47
+ line: number;
48
+ text: string;
49
+ }
50
+ interface SeastudioFileReadOptions {
51
+ rootId?: SeastudioFilesystemRootId;
52
+ offset?: number;
53
+ limit?: number;
54
+ }
55
+ interface SeastudioFileListOptions {
56
+ rootId?: SeastudioFilesystemRootId;
57
+ }
58
+ interface SeastudioFileTreeOptions {
59
+ rootId?: SeastudioFilesystemRootId;
60
+ depth?: number;
61
+ }
62
+ interface SeastudioFileInfoOptions {
63
+ rootId?: SeastudioFilesystemRootId;
64
+ }
65
+ interface SeastudioSinglePathOptions {
66
+ rootId?: SeastudioFilesystemRootId;
67
+ }
68
+ interface SeastudioFileDownloadOptions {
69
+ rootId?: SeastudioFilesystemRootId;
70
+ }
71
+ interface SeastudioFileSearchOptions {
72
+ rootId?: SeastudioFilesystemRootId;
73
+ path?: string;
74
+ glob?: string;
75
+ headLimit?: number;
76
+ }
77
+ type SeastudioWorkspacePathMode = 'workspace' | 'absolute';
78
+ interface SeastudioFileTransferOptions {
79
+ sourceRootId?: SeastudioFilesystemRootId;
80
+ destRootId?: SeastudioFilesystemRootId;
81
+ sourcePathMode?: SeastudioWorkspacePathMode;
82
+ destPathMode?: SeastudioWorkspacePathMode;
83
+ }
84
+ interface SeastudioBatchFlattenPreviewOptions {
85
+ sourceRootId?: SeastudioFilesystemRootId;
86
+ sourcePathMode?: SeastudioWorkspacePathMode;
87
+ }
88
+ interface SeastudioBatchFlattenCopyOptions extends SeastudioFileTransferOptions {
89
+ }
90
+ type SeastudioShellSessionEntryLevel = 'command' | 'stdout' | 'stderr' | 'meta';
91
+ interface SeastudioShellSessionEntry {
92
+ id: number;
93
+ level: SeastudioShellSessionEntryLevel;
94
+ content: string;
95
+ createdAt: number;
96
+ }
97
+ interface SeastudioShellSessionSnapshot {
98
+ projectPath: string | null;
99
+ cwd: string | null;
100
+ promptLabel: string;
101
+ isRunning: boolean;
102
+ lastExitCode: number | null;
103
+ lastDurationMs: number | null;
104
+ lastCommandAt: number | null;
105
+ historyCount: number;
106
+ entryCount: number;
107
+ }
108
+ interface SeastudioShellCommandResult {
109
+ command: string;
110
+ cwd: string;
111
+ exitCode: number;
112
+ stdout: string;
113
+ stderr: string;
114
+ error: string | null;
115
+ durationMs: number;
116
+ usedFallback: boolean;
117
+ }
118
+ declare function annotateTool(tool: MCPTool, annotations: MCPToolAnnotations, outputSchema?: MCPToolInputSchema): MCPTool;
119
+ declare const fileTools: MCPTool[];
120
+ declare const shellTools: MCPTool[];
121
+ declare const gitTools: MCPTool[];
122
+ declare const clipboardTools: MCPTool[];
123
+ declare const codeQualityTools: MCPTool[];
124
+ declare const batchFileTools: MCPTool[];
125
+ declare const seaCloudTools: MCPTool[];
126
+
127
+ declare const allTools: MCPTool[];
128
+ declare const tools: MCPTool[];
129
+ declare const seastudio: {
130
+ roots: {
131
+ list: () => Promise<{
132
+ roots: SeastudioFilesystemRoot[];
133
+ }>;
134
+ };
135
+ file: {
136
+ getSelected: () => Promise<MCPToolResult>;
137
+ read: (path: string, options?: SeastudioFileReadOptions) => Promise<MCPToolResult>;
138
+ write: (path: string, content: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
139
+ list: (path?: string, options?: SeastudioFileListOptions) => Promise<MCPToolResult>;
140
+ delete: (path: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
141
+ mkdir: (path: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
142
+ exists: (path: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
143
+ stat: (path: string, options?: SeastudioFileInfoOptions) => Promise<MCPToolResult>;
144
+ info: (path: string, options?: SeastudioFileInfoOptions) => Promise<MCPToolResult>;
145
+ search: (query: string, options?: SeastudioFileSearchOptions) => Promise<MCPToolResult>;
146
+ rename: (path: string, newName: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
147
+ move: (sourcePath: string, destDir: string, options?: SeastudioFileTransferOptions) => Promise<MCPToolResult>;
148
+ copyTo: (sourcePath: string, destDir: string, options?: SeastudioFileTransferOptions) => Promise<MCPToolResult>;
149
+ copy: (path: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
150
+ paste: (path?: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
151
+ clipboardCheck: () => Promise<MCPToolResult>;
152
+ copyPath: (path: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
153
+ trash: (path: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
154
+ batchFlattenPreview: (sourcePath: string, options?: SeastudioBatchFlattenPreviewOptions) => Promise<MCPToolResult>;
155
+ batchFlattenCopy: (sourcePath: string, destDir: string, taskId?: string, options?: SeastudioBatchFlattenCopyOptions) => Promise<MCPToolResult>;
156
+ getUrl: (path: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
157
+ download: (url: string, path: string, filenameHint?: string, options?: SeastudioFileDownloadOptions) => Promise<MCPToolResult>;
158
+ writeBinary: (path: string, base64: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
159
+ readBinary: (path: string, options?: SeastudioSinglePathOptions) => Promise<MCPToolResult>;
160
+ };
161
+ shell: {
162
+ execute: (command: string, cwd?: string, timeout?: number) => Promise<MCPToolResult>;
163
+ session: {
164
+ get: () => Promise<MCPToolResult>;
165
+ getEntries: (limit?: number) => Promise<MCPToolResult>;
166
+ runCommand: (command: string, cwd?: string, timeout?: number) => Promise<MCPToolResult>;
167
+ setCwd: (cwd: string) => Promise<MCPToolResult>;
168
+ clear: () => Promise<MCPToolResult>;
169
+ reset: () => Promise<MCPToolResult>;
170
+ };
171
+ };
172
+ git: {
173
+ status: () => Promise<MCPToolResult>;
174
+ diff: (staged?: boolean, path?: string) => Promise<MCPToolResult>;
175
+ };
176
+ codeQuality: {
177
+ runTest: (command?: string, timeout?: number) => Promise<MCPToolResult>;
178
+ runTypecheck: (command?: string, timeout?: number) => Promise<MCPToolResult>;
179
+ runLint: (command?: string, timeout?: number) => Promise<MCPToolResult>;
180
+ codeSearch: (pattern: string, path?: string, glob?: string, headLimit?: number) => Promise<MCPToolResult>;
181
+ };
182
+ };
183
+
184
+ /**
185
+ * SeaStudio MCP Notifications
186
+ *
187
+ * 主程序发布的 MCP 通知定义
188
+ *
189
+ * 架构说明:
190
+ * - 插件通过 SeastudioRequests 发送请求到主程序
191
+ * - 主程序处理请求后,通过 SeastudioNotifications 发布标准通知
192
+ * - 所有插件订阅 SeastudioNotifications 中的标准通知
193
+ */
194
+ /**
195
+ * 插件发送给主程序的请求主题
196
+ *
197
+ * 插件不应直接发布通知,而是发送请求,由主程序统一处理后发布标准通知。
198
+ *
199
+ * @example
200
+ * ```typescript
201
+ * import { getDefaultClient } from '@seastudio/sdk/mcp/core';
202
+ * import { SeastudioRequests } from '@seastudio/sdk/mcp/seastudio';
203
+ *
204
+ * const client = getDefaultClient();
205
+ * // 请求打开文件(主程序会发布 FILE_OPEN_REQUESTED 通知)
206
+ * client.publish(SeastudioRequests.FILE_OPEN, { path: '/path/to/file.ts' });
207
+ * ```
208
+ */
209
+ declare const SeastudioRequests: {
210
+ /** 请求打开文件 -> 主程序发布 FILE_OPEN_REQUESTED */
211
+ readonly FILE_OPEN: "request:file_open";
212
+ /** 请求标记文件已修改 -> 主程序发布 FILE_MODIFIED */
213
+ readonly FILE_MODIFIED: "request:file_modified";
214
+ /** 请求标记文件已保存 -> 主程序发布 FILE_SAVED */
215
+ readonly FILE_SAVED: "request:file_saved";
216
+ /** 请求发送文本给 Agent -> 主程序发布 TEXT_SEND_REQUESTED */
217
+ readonly TEXT_SEND: "request:text_send";
218
+ };
219
+ /**
220
+ * SeaStudio 主程序发布的通知主题
221
+ *
222
+ * 这些通知由主程序统一发布,插件应订阅这些通知以获取状态更新。
223
+ *
224
+ * @example
225
+ * ```typescript
226
+ * import { getDefaultServer, getDefaultClient } from '@seastudio/sdk/mcp/core';
227
+ * import { SeastudioNotifications } from '@seastudio/sdk/mcp/seastudio';
228
+ *
229
+ * // 订阅通知
230
+ * const client = getDefaultClient();
231
+ * client.subscribe([SeastudioNotifications.FILES_CHANGED]);
232
+ *
233
+ * // 处理通知
234
+ * const server = getDefaultServer();
235
+ * server.onNotification(SeastudioNotifications.FILES_CHANGED, (params) => {
236
+ * const { type, path } = params as FilesChangedParams;
237
+ * // 刷新文件树
238
+ * });
239
+ * ```
240
+ */
241
+ declare const SeastudioNotifications: {
242
+ /** 文件系统变化通知(fs.watch 触发) */
243
+ readonly FILES_CHANGED: "files:changed";
244
+ /** 根目录变化通知 */
245
+ readonly ROOTS_CHANGED: "roots:changed";
246
+ /** 文件打开请求,可广播也可定向 */
247
+ readonly FILE_OPEN_REQUESTED: "seastudio:file-open_requested";
248
+ /** 文件已修改通知(内容变化,未保存) */
249
+ readonly FILE_MODIFIED: "file:modified";
250
+ /** 文件已保存通知 */
251
+ readonly FILE_SAVED: "file:saved";
252
+ /** 文件发送请求 */
253
+ readonly FILE_SEND_REQUESTED: "seastudio:file-send_requested";
254
+ /** 文本发送请求 */
255
+ readonly TEXT_SEND_REQUESTED: "seastudio:text-send_requested";
256
+ };
257
+ /**
258
+ * files:changed 通知参数
259
+ */
260
+ interface FilesChangedParams {
261
+ /** 变化类型:project(工作区) */
262
+ type: 'project';
263
+ /** 发生变化的目录路径 */
264
+ path: string;
265
+ }
266
+ interface RootsChangedParams {
267
+ roots: Array<{
268
+ id: 'workspace';
269
+ label: string;
270
+ description: string;
271
+ }>;
272
+ }
273
+ type SeastudioDragRootId = 'workspace';
274
+ interface SeastudioDragFileData {
275
+ sourcePath: string;
276
+ sourceRootId?: SeastudioDragRootId;
277
+ sourcePlugin?: string;
278
+ sourceType: 'file' | 'directory';
279
+ sourceZone: string;
280
+ isExternal?: boolean;
281
+ }
282
+ interface SeastudioDragStartParams extends SeastudioDragFileData {
283
+ pluginId?: string;
284
+ }
285
+ interface SeastudioDragEnterParams extends SeastudioDragFileData {
286
+ }
287
+ interface SeastudioDragDropParams extends SeastudioDragFileData {
288
+ }
289
+ interface FileTransferRequestedParams {
290
+ source: 'workspace';
291
+ rootId: 'workspace';
292
+ path: string;
293
+ name: string;
294
+ kind: 'file' | 'directory';
295
+ isDirectory: boolean;
296
+ }
297
+ interface FileOpenRequestedParams extends FileTransferRequestedParams {
298
+ }
299
+ interface FileSendRequestedParams extends FileTransferRequestedParams {
300
+ }
301
+ interface TextSendRequestedSelectionRange {
302
+ startLine?: number;
303
+ startColumn?: number;
304
+ endLine?: number;
305
+ endColumn?: number;
306
+ }
307
+ interface TextSendRequestedSource {
308
+ type: 'editor' | 'plugin';
309
+ id?: string;
310
+ label?: string;
311
+ path?: string;
312
+ uri?: string;
313
+ language?: string;
314
+ selection?: TextSendRequestedSelectionRange;
315
+ }
316
+ interface TextSendRequestedParams {
317
+ source: TextSendRequestedSource;
318
+ text: string;
319
+ }
320
+ /**
321
+ * file:modified 通知参数
322
+ */
323
+ interface FileModifiedParams {
324
+ /** 文件路径 */
325
+ path: string;
326
+ /** 是否有未保存的修改 */
327
+ isDirty: boolean;
328
+ /** 触发来源插件 ID */
329
+ source?: string;
330
+ }
331
+ /**
332
+ * file:saved 通知参数
333
+ */
334
+ interface FileSavedParams {
335
+ /** 文件路径 */
336
+ path: string;
337
+ /** 触发来源插件 ID */
338
+ source?: string;
339
+ }
340
+
341
+ export { type FileModifiedParams, type FileOpenRequestedParams, type FileSavedParams, type FileSendRequestedParams, type FileTransferRequestedParams, type FilesChangedParams, type RootsChangedParams, type SeastudioBatchFlattenCopyOptions, type SeastudioBatchFlattenPreviewOptions, type SeastudioDragDropParams, type SeastudioDragEnterParams, type SeastudioDragFileData, type SeastudioDragRootId, type SeastudioDragStartParams, type SeastudioFileDownloadOptions, type SeastudioFileInfo, type SeastudioFileInfoOptions, type SeastudioFileListOptions, type SeastudioFileReadOptions, type SeastudioFileSearchMatch, type SeastudioFileSearchOptions, type SeastudioFileTransferOptions, type SeastudioFileTreeOptions, type SeastudioFilesystemRoot, type SeastudioFilesystemRootId, SeastudioNotifications, SeastudioRequests, type SeastudioShellCommandResult, type SeastudioShellSessionEntry, type SeastudioShellSessionEntryLevel, type SeastudioShellSessionSnapshot, type SeastudioSinglePathOptions, type SeastudioWorkspacePathMode, type TextSendRequestedParams, type TextSendRequestedSelectionRange, type TextSendRequestedSource, agentManagementTools, agentTabTools, allTools, annotateTool, batchFileTools, clipboardTools, codeQualityTools, fileTools, gitTools, pluginManagementTools, pluginTabTools, seaCloudTools, seastudio, shellTools, tools };
@@ -0,0 +1,2 @@
1
+ export { SeastudioNotifications, SeastudioRequests, agentManagementTools, agentTabTools, allTools, annotateTool, batchFileTools, clipboardTools, codeQualityTools, fileTools, gitTools, pluginManagementTools, pluginTabTools, seaCloudTools, seastudio, shellTools, tools } from '../../chunk-DDVRUPMZ.js';
2
+ import '../../chunk-ANWOL7SM.js';
@@ -0,0 +1,2 @@
1
+ export { commandTools, sessionTools, shellPlugin, tools } from './chunk-FLATZQA2.js';
2
+ import './chunk-ANWOL7SM.js';