@seastudio/sdk 3.7.3 → 4.0.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.
@@ -1,1822 +0,0 @@
1
- import { getDefaultClient } from './chunk-TJ3CGHWJ.js';
2
-
3
- // src/mcp/seastudio/tools-file.ts
4
- function annotateTool(tool, annotations, outputSchema) {
5
- return {
6
- ...tool,
7
- annotations,
8
- ...outputSchema ? { outputSchema } : {}
9
- };
10
- }
11
- var rootedPathEvidenceOutputSchema = {
12
- type: "object",
13
- properties: {
14
- rootId: { type: "string" },
15
- path: { type: "string" }
16
- },
17
- required: ["rootId", "path"]
18
- };
19
- var rootedWriteEvidenceOutputSchema = {
20
- type: "object",
21
- properties: {
22
- rootId: { type: "string" },
23
- path: { type: "string" },
24
- written: { type: "boolean" }
25
- },
26
- required: ["rootId", "path", "written"]
27
- };
28
- var dualPathEvidenceOutputSchema = {
29
- type: "object",
30
- properties: {
31
- sourceRootId: { type: "string" },
32
- sourcePath: { type: "string" },
33
- destRootId: { type: "string" },
34
- destPath: { type: "string" }
35
- },
36
- required: ["sourceRootId", "sourcePath", "destRootId", "destPath"]
37
- };
38
- var batchFlattenCopyEvidenceOutputSchema = {
39
- type: "object",
40
- properties: {
41
- sourceRootId: { type: "string" },
42
- sourcePath: { type: "string" },
43
- destRootId: { type: "string" },
44
- destPath: { type: "string" },
45
- copiedCount: { type: "number" },
46
- totalCount: { type: "number" },
47
- errors: { type: "array", items: { type: "object", additionalProperties: true } }
48
- },
49
- required: ["sourceRootId", "sourcePath", "destRootId", "destPath", "copiedCount", "totalCount", "errors"]
50
- };
51
- var fileDownloadEvidenceOutputSchema = {
52
- type: "object",
53
- properties: {
54
- location: { type: "string", enum: ["workspace", "absolute"] },
55
- rootId: { type: "string" },
56
- absoluteDir: { type: "string" },
57
- path: { type: "string" },
58
- savedPath: { type: "string" },
59
- size: { type: "number" },
60
- mime: { type: "string" }
61
- },
62
- required: ["location", "path", "savedPath", "size"]
63
- };
64
- var fileUrlEvidenceOutputSchema = {
65
- type: "object",
66
- properties: {
67
- rootId: { type: "string" },
68
- path: { type: "string" },
69
- url: { type: "string" },
70
- filename: { type: "string" },
71
- size: { type: "number" },
72
- checksum: { type: "string" }
73
- },
74
- required: ["rootId", "path", "url", "filename", "size"]
75
- };
76
- var shellSessionSnapshotEvidenceOutputSchema = {
77
- type: "object",
78
- properties: {
79
- sessionId: { type: "string" },
80
- shell: { type: "string", enum: ["bash", "pwsh", "cmd", "sh"] },
81
- cwd: { type: "string" },
82
- pid: { type: "number" },
83
- alive: { type: "boolean" },
84
- openedAt: { type: "number" },
85
- label: { type: "string" },
86
- pluginId: { type: "string" },
87
- projectId: { type: "string" },
88
- agentInstanceId: { type: "string" },
89
- pendingCommandId: { type: "string" },
90
- lastCommandId: { type: "string" },
91
- lastExitCode: { type: "number" },
92
- lastDurationMs: { type: "number" },
93
- entryCount: { type: "number" },
94
- droppedCount: { type: "number" }
95
- },
96
- required: ["sessionId", "shell", "pid", "alive", "openedAt", "entryCount", "droppedCount"]
97
- };
98
- var shellSessionOpenEvidenceOutputSchema = {
99
- type: "object",
100
- properties: {
101
- sessionId: { type: "string" },
102
- shell: { type: "string", enum: ["bash", "pwsh", "cmd", "sh"] },
103
- cwd: { type: "string" },
104
- pid: { type: "number" },
105
- openedAt: { type: "number" }
106
- },
107
- required: ["sessionId", "shell", "pid", "openedAt"]
108
- };
109
- var shellSessionRunEvidenceOutputSchema = {
110
- type: "object",
111
- properties: {
112
- sessionId: { type: "string" },
113
- commandId: { type: "string" },
114
- startedAt: { type: "number" },
115
- running: { type: "boolean" }
116
- },
117
- required: ["sessionId", "commandId", "startedAt", "running"]
118
- };
119
- var shellSessionSignalEvidenceOutputSchema = {
120
- type: "object",
121
- properties: {
122
- sessionId: { type: "string" },
123
- signal: { type: "string", enum: ["INT", "TERM", "KILL"] },
124
- ok: { type: "boolean" },
125
- deliveredAt: { type: "number" }
126
- },
127
- required: ["sessionId", "signal", "ok", "deliveredAt"]
128
- };
129
- var shellSessionCloseEvidenceOutputSchema = {
130
- type: "object",
131
- properties: {
132
- sessionId: { type: "string" },
133
- closed: { type: "boolean" },
134
- exitCode: { type: "number" }
135
- },
136
- required: ["sessionId", "closed"]
137
- };
138
- var fileTools = [
139
- annotateTool({
140
- name: "seastudio-file_get_selected",
141
- description: "\u83B7\u53D6\u5F53\u524D\u6587\u4EF6\u89C6\u56FE\u9009\u4E2D\u7684\u6587\u4EF6\u6216\u76EE\u5F55\u3002\u9002\u7528\u4E8E\u7EED\u63A5\u201C\u5F53\u524D\u9009\u4E2D\u9879\u201D\u7684\u4E0A\u4E0B\u6587\u3002",
142
- inputSchema: {
143
- type: "object",
144
- properties: {}
145
- }
146
- }, {
147
- operationKind: "read",
148
- requiresExecutionEvidence: false,
149
- rawDomain: "filesystem"
150
- }),
151
- annotateTool({
152
- name: "seastudio-file_read",
153
- description: "\u8BFB\u53D6\u6307\u5B9A\u6587\u4EF6\u7684\u6587\u672C\u5185\u5BB9\uFF0C\u9ED8\u8BA4\u6309 utf-8 \u89E3\u7801\uFF0C\u4E5F\u53EF\u901A\u8FC7 encoding \u6307\u5B9A\u5176\u4ED6\u6587\u672C\u7F16\u7801\u3002\u9002\u7528\u4E8E\u67E5\u770B\u3001\u5F15\u7528\u6216\u5206\u6790\u5DF2\u77E5\u8DEF\u5F84\u7684\u4EE3\u7801/\u914D\u7F6E/\u6587\u6863\u6587\u4EF6\uFF0C\u4E0D\u4F1A\u4FEE\u6539\u9879\u76EE\u3002\u4E0D\u8981\u6839\u636E\u6587\u4EF6\u540E\u7F00\u81EA\u884C\u62D2\u7EDD\u8BFB\u53D6\uFF1B\u53EA\u5728\u786E\u8BA4\u9700\u8981 base64 \u8BFB\u53D6\u771F\u5B9E\u4E8C\u8FDB\u5236\u6587\u4EF6\u65F6\u624D\u6539\u7528 seastudio-file_read_binary\u3002",
154
- inputSchema: {
155
- type: "object",
156
- properties: {
157
- rootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
158
- path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E rootId\uFF09" },
159
- encoding: { type: "string", description: "\u6587\u672C\u7F16\u7801\uFF08\u53EF\u9009\uFF0C\u9ED8\u8BA4 'utf-8'\uFF1B\u4F8B\u5982 utf-8\u3001utf-16le\u3001gbk\u3001gb18030\u3001big5\u3001latin1\uFF09" },
160
- offset: { type: "number", description: "\u8D77\u59CB\u884C\u504F\u79FB\uFF08\u53EF\u9009\uFF09" },
161
- limit: { type: "number", description: "\u8BFB\u53D6\u884C\u6570\u9650\u5236\uFF08\u53EF\u9009\uFF09" }
162
- },
163
- required: ["rootId", "path"]
164
- }
165
- }, {
166
- operationKind: "read",
167
- requiresExecutionEvidence: false,
168
- rawDomain: "filesystem"
169
- }),
170
- annotateTool({
171
- name: "seastudio-file_write",
172
- description: "\u5C06\u6587\u672C\u5185\u5BB9\u5199\u5165\u6307\u5B9A\u8DEF\u5F84\u3002\u4EC5\u5728\u9700\u8981\u771F\u5B9E\u521B\u5EFA\u6216\u4FEE\u6539\u6587\u4EF6\u65F6\u4F7F\u7528\uFF0C\u6210\u529F\u540E\u6587\u4EF6\u5185\u5BB9\u4F1A\u843D\u76D8\u3002",
173
- inputSchema: {
174
- type: "object",
175
- properties: {
176
- rootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
177
- path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E rootId\uFF09" },
178
- content: { type: "string", description: "\u6587\u4EF6\u5185\u5BB9" }
179
- },
180
- required: ["rootId", "path", "content"]
181
- }
182
- }, {
183
- operationKind: "mutate",
184
- requiresExecutionEvidence: true,
185
- rawDomain: "workspace"
186
- }, rootedWriteEvidenceOutputSchema),
187
- annotateTool({
188
- name: "seastudio-file_list",
189
- description: "\u5217\u51FA\u6307\u5B9A\u76EE\u5F55\u7684\u76F4\u63A5\u5B50\u9879\uFF08\u4E0D\u9012\u5F52\uFF0C\u7C7B\u4F3C ls\uFF09\u3002\u9002\u7528\u4E8E\u5728\u6267\u884C\u8BFB\u5199\u524D\u786E\u8BA4\u76EE\u5F55\u5185\u5BB9\u6216\u5B9A\u4F4D\u76EE\u6807\u8DEF\u5F84\u3002\u5982\u9700\u9012\u5F52\u904D\u5386\u5B50\u6811\u8BF7\u4F7F\u7528 seastudio-file_tree\u3002",
190
- inputSchema: {
191
- type: "object",
192
- properties: {
193
- rootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
194
- path: { type: "string", description: "\u76EE\u5F55\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E rootId\uFF09" }
195
- },
196
- required: ["rootId", "path"]
197
- }
198
- }, {
199
- operationKind: "read",
200
- requiresExecutionEvidence: false,
201
- rawDomain: "filesystem"
202
- }),
203
- annotateTool({
204
- name: "seastudio-file_tree",
205
- description: "\u9012\u5F52\u5217\u51FA\u6307\u5B9A\u76EE\u5F55\u7684\u6574\u4E2A\u5B50\u6811\uFF08\u6241\u5E73 items \u5217\u8868\uFF0C\u6BCF\u9879\u542B\u76F8\u5BF9 rootId \u7684\u6839\u76F8\u5BF9\u8DEF\u5F84\uFF09\u3002\u4EC5\u5728\u786E\u5B9E\u9700\u8981\u5168\u6811\u89C6\u56FE\u65F6\u4F7F\u7528\uFF1B\u8FD4\u56DE\u7ED3\u679C\u53EF\u80FD\u5F88\u5927\uFF0C\u5EFA\u8BAE\u4F18\u5148\u4F7F\u7528 seastudio-file_list \u6309\u9700\u9010\u5C42\u63A2\u7D22\u3002",
206
- inputSchema: {
207
- type: "object",
208
- properties: {
209
- rootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
210
- path: { type: "string", description: "\u76EE\u5F55\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E rootId\uFF09" },
211
- maxDepth: { type: "number", description: "\u6700\u5927\u9012\u5F52\u6DF1\u5EA6\uFF080 \u8868\u793A\u53EA\u5217\u5F53\u524D\u76EE\u5F55\uFF0C\u7B49\u4EF7\u4E8E file_list\uFF1B\u7701\u7565\u8868\u793A\u4E0D\u9650\u5236\uFF09" },
212
- maxEntries: { type: "number", description: "\u6700\u591A\u8FD4\u56DE\u591A\u5C11\u4E2A\u6761\u76EE\uFF0C\u8D85\u51FA\u540E\u622A\u65AD\u5E76\u5728\u54CD\u5E94\u91CC truncated=true\uFF08\u9ED8\u8BA4 50000\uFF09" }
213
- },
214
- required: ["rootId", "path"]
215
- }
216
- }, {
217
- operationKind: "read",
218
- requiresExecutionEvidence: false,
219
- rawDomain: "filesystem"
220
- }),
221
- annotateTool({
222
- name: "seastudio-file_delete",
223
- description: "\u5220\u9664\u6307\u5B9A\u8DEF\u5F84\u7684\u6587\u4EF6\u6216\u76EE\u5F55\u3002\u4EC5\u5728\u7528\u6237\u660E\u786E\u8981\u6C42\u79FB\u9664\u76EE\u6807\u65F6\u4F7F\u7528\uFF0C\u6210\u529F\u540E\u76EE\u6807\u4F1A\u4ECE\u9879\u76EE\u4E2D\u6D88\u5931\u3002",
224
- inputSchema: {
225
- type: "object",
226
- properties: {
227
- rootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
228
- path: { type: "string", description: "\u8981\u5220\u9664\u7684\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E rootId\uFF09" }
229
- },
230
- required: ["rootId", "path"]
231
- }
232
- }, {
233
- operationKind: "mutate",
234
- requiresExecutionEvidence: true,
235
- rawDomain: "workspace"
236
- }, rootedPathEvidenceOutputSchema),
237
- annotateTool({
238
- name: "seastudio-file_mkdir",
239
- description: "\u521B\u5EFA\u76EE\u5F55\uFF08\u652F\u6301\u9012\u5F52\u521B\u5EFA\uFF09\u3002\u9002\u7528\u4E8E\u4E3A\u65B0\u6587\u4EF6\u6216\u5BFC\u51FA\u7ED3\u679C\u51C6\u5907\u76EE\u6807\u76EE\u5F55\u3002",
240
- inputSchema: {
241
- type: "object",
242
- properties: {
243
- rootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
244
- path: { type: "string", description: "\u76EE\u5F55\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E rootId\uFF09" }
245
- },
246
- required: ["rootId", "path"]
247
- }
248
- }, {
249
- operationKind: "mutate",
250
- requiresExecutionEvidence: true,
251
- rawDomain: "workspace"
252
- }, rootedPathEvidenceOutputSchema),
253
- annotateTool({
254
- name: "seastudio-file_exists",
255
- description: "\u68C0\u67E5\u6587\u4EF6\u6216\u76EE\u5F55\u662F\u5426\u5B58\u5728\u3002\u9002\u7528\u4E8E\u5728\u6267\u884C\u5199\u5165\u3001\u5220\u9664\u3001\u91CD\u547D\u540D\u524D\u505A\u524D\u7F6E\u5224\u65AD\u3002",
256
- inputSchema: {
257
- type: "object",
258
- properties: {
259
- rootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
260
- path: { type: "string", description: "\u8981\u68C0\u67E5\u7684\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E rootId\uFF09" }
261
- },
262
- required: ["rootId", "path"]
263
- }
264
- }, {
265
- operationKind: "read",
266
- requiresExecutionEvidence: false,
267
- rawDomain: "workspace"
268
- }),
269
- annotateTool({
270
- name: "seastudio-file_stat",
271
- description: "\u83B7\u53D6\u6587\u4EF6\u6216\u76EE\u5F55\u7684\u72B6\u6001\u4FE1\u606F\uFF0C\u5982\u7C7B\u578B\u3001\u5927\u5C0F\u548C\u4FEE\u6539\u65F6\u95F4\uFF0C\u7528\u4E8E\u5224\u65AD\u76EE\u6807\u5BF9\u8C61\u7279\u5F81\u3002",
272
- inputSchema: {
273
- type: "object",
274
- properties: {
275
- rootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
276
- path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84" }
277
- },
278
- required: ["rootId", "path"]
279
- }
280
- }, {
281
- operationKind: "read",
282
- requiresExecutionEvidence: false,
283
- rawDomain: "filesystem"
284
- }),
285
- annotateTool({
286
- name: "seastudio-file_info",
287
- description: "\u83B7\u53D6\u6587\u4EF6\u6216\u76EE\u5F55\u7684\u8BE6\u7EC6\u4FE1\u606F\uFF0C\u5982\u7C7B\u578B\u3001\u5927\u5C0F\u3001\u4FEE\u6539\u65F6\u95F4\u548C MIME\uFF0C\u7528\u4E8E\u5728\u8BFB\u53D6\u524D\u505A\u5224\u65AD\u3002",
288
- inputSchema: {
289
- type: "object",
290
- properties: {
291
- rootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
292
- path: { type: "string", description: "\u6587\u4EF6\u6216\u76EE\u5F55\u8DEF\u5F84" }
293
- },
294
- required: ["rootId", "path"]
295
- }
296
- }, {
297
- operationKind: "read",
298
- requiresExecutionEvidence: false,
299
- rawDomain: "filesystem"
300
- }),
301
- annotateTool({
302
- name: "seastudio-file_search",
303
- description: "\u5728\u6307\u5B9A root \u4E2D\u6309 query \u641C\u7D22\u6587\u4EF6\u5185\u5BB9\uFF0C\u53EF\u9009\u9650\u5B9A\u5B50\u8DEF\u5F84\u548C glob\u3002",
304
- inputSchema: {
305
- type: "object",
306
- properties: {
307
- rootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
308
- query: { type: "string", description: "\u641C\u7D22\u5185\u5BB9\u6216\u6A21\u5F0F" },
309
- path: { type: "string", description: "\u76F8\u5BF9 root \u7684\u641C\u7D22\u5B50\u8DEF\u5F84\uFF08\u53EF\u9009\uFF09" },
310
- glob: { type: "string", description: "\u6587\u4EF6 glob \u6A21\u5F0F\uFF08\u53EF\u9009\uFF09" },
311
- headLimit: { type: "number", description: "\u8FD4\u56DE\u7ED3\u679C\u6570\u91CF\u9650\u5236\uFF08\u53EF\u9009\uFF09" }
312
- },
313
- required: ["rootId", "query"]
314
- }
315
- }, {
316
- operationKind: "read",
317
- requiresExecutionEvidence: false,
318
- rawDomain: "filesystem"
319
- }),
320
- annotateTool({
321
- name: "seastudio-file_rename",
322
- description: "\u91CD\u547D\u540D\u6587\u4EF6\u6216\u76EE\u5F55\u3002\u4EC5\u5728\u7528\u6237\u660E\u786E\u8981\u6C42\u6539\u540D\u65F6\u4F7F\u7528\uFF0C\u6210\u529F\u540E\u539F\u8DEF\u5F84\u4F1A\u53D8\u66F4\u4E3A\u65B0\u540D\u79F0\u3002",
323
- inputSchema: {
324
- type: "object",
325
- properties: {
326
- rootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
327
- path: { type: "string", description: "\u539F\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E rootId\uFF09" },
328
- newName: { type: "string", description: "\u65B0\u540D\u79F0" }
329
- },
330
- required: ["rootId", "path", "newName"]
331
- }
332
- }, {
333
- operationKind: "mutate",
334
- requiresExecutionEvidence: true,
335
- rawDomain: "workspace"
336
- }, rootedPathEvidenceOutputSchema),
337
- annotateTool({
338
- name: "seastudio-file_move",
339
- description: "\u5C06\u6E90\u8DEF\u5F84\u79FB\u52A8\u5230\u76EE\u6807\u8DEF\u5F84\u3002\u8DEF\u5F84\u7EDF\u4E00\u4F7F\u7528 rootId + path\u3002",
340
- inputSchema: {
341
- type: "object",
342
- properties: {
343
- sourceRootId: { type: "string", description: "\u6E90\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
344
- sourcePath: { type: "string", description: "\u6E90\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E sourceRootId\uFF09" },
345
- destRootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
346
- destPath: { type: "string", description: "\u76EE\u6807\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E destRootId\uFF09" }
347
- },
348
- required: ["sourceRootId", "sourcePath", "destRootId", "destPath"]
349
- }
350
- }, {
351
- operationKind: "mutate",
352
- requiresExecutionEvidence: true,
353
- rawDomain: "workspace"
354
- }, dualPathEvidenceOutputSchema),
355
- annotateTool({
356
- name: "seastudio-file_copy_to",
357
- description: "\u5C06\u6E90\u8DEF\u5F84\u590D\u5236\u5230\u76EE\u6807\u8DEF\u5F84\u3002\u8DEF\u5F84\u7EDF\u4E00\u4F7F\u7528 rootId + path\u3002",
358
- inputSchema: {
359
- type: "object",
360
- properties: {
361
- sourceRootId: { type: "string", description: "\u6E90\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
362
- sourcePath: { type: "string", description: "\u6E90\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E sourceRootId\uFF09" },
363
- destRootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
364
- destPath: { type: "string", description: "\u76EE\u6807\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E destRootId\uFF09" }
365
- },
366
- required: ["sourceRootId", "sourcePath", "destRootId", "destPath"]
367
- }
368
- }, {
369
- operationKind: "mutate",
370
- requiresExecutionEvidence: true,
371
- rawDomain: "workspace"
372
- }, dualPathEvidenceOutputSchema),
373
- annotateTool({
374
- name: "seastudio-file_get_url",
375
- description: "\u4E0A\u4F20\u6307\u5B9A\u6839\u76EE\u5F55\u4E2D\u7684\u6587\u4EF6\u5E76\u8FD4\u56DE\u53EF\u8BBF\u95EE URL\u3002\u8C03\u7528\u65F6\u4F20\u5165 rootId + path\uFF0CSeaStudio \u4F1A\u901A\u8FC7 dataserver \u4E0A\u4F20\u8BE5\u6587\u4EF6\u3002",
376
- inputSchema: {
377
- type: "object",
378
- properties: {
379
- rootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
380
- path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E rootId\uFF09" }
381
- },
382
- required: ["rootId", "path"]
383
- }
384
- }, {
385
- operationKind: "read",
386
- requiresExecutionEvidence: true,
387
- rawDomain: "filesystem"
388
- }, fileUrlEvidenceOutputSchema),
389
- annotateTool({
390
- name: "seastudio-file_download",
391
- description: "\u4ECE\u8FDC\u7A0B URL \u4E0B\u8F7D\u6587\u4EF6\u3002\u4E8C\u9009\u4E00\uFF1A\u2460 \u5728\u76EE\u6807\u9879\u76EE\u6839\u4E0B\u6307\u5B9A\u76F8\u5BF9\u5B50\u76EE\u5F55\uFF08rootId + path\uFF09\uFF1B\u2461 \u6307\u5B9A absoluteDir \u4E3A\u672C\u5730\u7EDD\u5BF9\u8DEF\u5F84\u76EE\u5F55\uFF08\u542B ~/ \u5C55\u5F00\uFF09\uFF0C\u5FFD\u7565 rootId/path\u3002\u4EC5\u5728\u9700\u8981\u771F\u5B9E\u5F15\u5165\u8FDC\u7AEF\u8D44\u6E90\u65F6\u4F7F\u7528\u3002",
392
- inputSchema: {
393
- type: "object",
394
- properties: {
395
- rootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF08\u4E0E path \u8054\u7528\uFF1B\u82E5\u63D0\u4F9B absoluteDir \u5219\u5FFD\u7565\uFF09\u3002'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u6309 id \u5BFB\u5740\u3002" },
396
- path: { type: "string", description: "\u4FDD\u5B58\u76EE\u5F55\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E rootId\uFF1B\u672A\u4F7F\u7528 absoluteDir \u65F6\u5FC5\u586B\uFF09" },
397
- absoluteDir: {
398
- type: "string",
399
- description: "\u672C\u5730\u7EDD\u5BF9\u8DEF\u5F84\u76EE\u5F55\uFF08\u53EF\u542B ~ \u6216 ~/\uFF09\uFF1B\u82E5\u8BBE\u7F6E\u5219\u4E0B\u8F7D\u5230\u6B64\u76EE\u5F55\uFF0C\u4E0D\u518D\u4F7F\u7528 workspace \u76F8\u5BF9\u8DEF\u5F84"
400
- },
401
- url: { type: "string", description: "\u8FDC\u7A0B\u6587\u4EF6 URL" },
402
- filenameHint: { type: "string", description: "\u6587\u4EF6\u540D\u63D0\u793A\uFF08\u53EF\u9009\uFF09" }
403
- },
404
- required: ["url"]
405
- }
406
- }, {
407
- operationKind: "mutate",
408
- requiresExecutionEvidence: true,
409
- rawDomain: "filesystem"
410
- }, fileDownloadEvidenceOutputSchema),
411
- annotateTool({
412
- name: "seastudio-file_write_binary",
413
- description: "\u5C06 base64 \u7F16\u7801\u7684\u4E8C\u8FDB\u5236\u5185\u5BB9\u5199\u5165\u6307\u5B9A\u8DEF\u5F84\uFF0C\u9002\u7528\u4E8E xlsx/xls \u7B49\u4E8C\u8FDB\u5236\u6587\u4EF6\u7684\u4FDD\u5B58\u3002",
414
- inputSchema: {
415
- type: "object",
416
- properties: {
417
- rootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
418
- path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E rootId\uFF09" },
419
- base64: { type: "string", description: "base64 \u7F16\u7801\u7684\u6587\u4EF6\u5185\u5BB9" }
420
- },
421
- required: ["rootId", "path", "base64"]
422
- }
423
- }, {
424
- operationKind: "mutate",
425
- requiresExecutionEvidence: true,
426
- rawDomain: "workspace"
427
- }),
428
- annotateTool({
429
- name: "seastudio-file_read_binary",
430
- description: "\u8BFB\u53D6\u4E8C\u8FDB\u5236\u6587\u4EF6\u5E76\u8FD4\u56DE base64 \u7F16\u7801\u5185\u5BB9\uFF0C\u9002\u7528\u4E8E xlsx/xls \u7B49\u4E8C\u8FDB\u5236\u6587\u4EF6\u7684\u8BFB\u53D6\u3002",
431
- inputSchema: {
432
- type: "object",
433
- properties: {
434
- rootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
435
- path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E rootId\uFF09" }
436
- },
437
- required: ["rootId", "path"]
438
- }
439
- }, {
440
- operationKind: "read",
441
- rawDomain: "filesystem"
442
- }),
443
- annotateTool({
444
- name: "seastudio-file_copy",
445
- description: "\u590D\u5236\u6587\u4EF6\u8DEF\u5F84\u5230\u526A\u8D34\u677F\uFF08\u7528\u4E8E\u540E\u7EED\u7C98\u8D34\uFF09",
446
- inputSchema: {
447
- type: "object",
448
- properties: {
449
- rootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
450
- path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E rootId\uFF09" }
451
- },
452
- required: ["rootId", "path"]
453
- }
454
- }, {
455
- operationKind: "system",
456
- requiresExecutionEvidence: true,
457
- rawDomain: "workspace"
458
- }, rootedPathEvidenceOutputSchema),
459
- annotateTool({
460
- name: "seastudio-file_paste",
461
- description: "\u4ECE\u526A\u8D34\u677F\u7C98\u8D34\u6587\u4EF6/\u6587\u4EF6\u5939",
462
- inputSchema: {
463
- type: "object",
464
- properties: {
465
- rootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
466
- path: { type: "string", description: "\u76EE\u6807\u76EE\u5F55\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E rootId\uFF09" }
467
- },
468
- required: ["rootId", "path"]
469
- }
470
- }, {
471
- operationKind: "system",
472
- requiresExecutionEvidence: true,
473
- rawDomain: "workspace"
474
- }, rootedPathEvidenceOutputSchema),
475
- annotateTool({
476
- name: "seastudio-file_clipboard_check",
477
- description: "\u68C0\u67E5\u526A\u8D34\u677F\u662F\u5426\u6709\u6709\u6548\u7684\u6587\u4EF6\u8DEF\u5F84",
478
- inputSchema: {
479
- type: "object",
480
- properties: {}
481
- }
482
- }, {
483
- operationKind: "read",
484
- requiresExecutionEvidence: false,
485
- rawDomain: "workspace"
486
- }),
487
- annotateTool({
488
- name: "seastudio-file_copy_path",
489
- description: "\u590D\u5236\u6587\u4EF6\u8DEF\u5F84\u6587\u672C\u5230\u526A\u8D34\u677F",
490
- inputSchema: {
491
- type: "object",
492
- properties: {
493
- rootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
494
- path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E rootId\uFF09" }
495
- },
496
- required: ["rootId", "path"]
497
- }
498
- }, {
499
- operationKind: "system",
500
- requiresExecutionEvidence: true,
501
- rawDomain: "workspace"
502
- }, rootedPathEvidenceOutputSchema),
503
- annotateTool({
504
- name: "seastudio-file_trash",
505
- description: "\u5C06\u6587\u4EF6\u6216\u6587\u4EF6\u5939\u79FB\u52A8\u5230\u7CFB\u7EDF\u56DE\u6536\u7AD9\u3002\u4EC5\u5728\u7528\u6237\u660E\u786E\u8981\u6C42\u79FB\u9664\u76EE\u6807\u4F46\u4FDD\u7559\u53EF\u6062\u590D\u6027\u65F6\u4F7F\u7528\u3002",
506
- inputSchema: {
507
- type: "object",
508
- properties: {
509
- rootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
510
- path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E rootId\uFF09" }
511
- },
512
- required: ["rootId", "path"]
513
- }
514
- }, {
515
- operationKind: "mutate",
516
- requiresExecutionEvidence: true,
517
- rawDomain: "workspace"
518
- }, rootedPathEvidenceOutputSchema),
519
- annotateTool({
520
- name: "seastudio-code_search",
521
- description: "\u5728\u9879\u76EE\u4E2D\u6309\u6A21\u5F0F\u641C\u7D22\u4EE3\u7801\u6216\u6587\u672C\u5185\u5BB9\u3002\u9002\u7528\u4E8E\u5B9A\u4F4D\u5B9A\u4E49\u3001\u8C03\u7528\u70B9\u6216\u6587\u672C\u7247\u6BB5\uFF0C\u4E0D\u4F1A\u4FEE\u6539\u6587\u4EF6\u3002",
522
- inputSchema: {
523
- type: "object",
524
- properties: {
525
- pattern: { type: "string", description: "\u641C\u7D22\u6A21\u5F0F\uFF08\u6B63\u5219\u8868\u8FBE\u5F0F\uFF09" },
526
- path: { type: "string", description: "\u641C\u7D22\u8DEF\u5F84" },
527
- glob: { type: "string", description: "\u6587\u4EF6 glob \u6A21\u5F0F" },
528
- headLimit: { type: "number", description: "\u8FD4\u56DE\u7ED3\u679C\u6570\u91CF\u9650\u5236" }
529
- },
530
- required: ["pattern"]
531
- }
532
- }, {
533
- operationKind: "read",
534
- requiresExecutionEvidence: false,
535
- rawDomain: "workspace"
536
- }),
537
- annotateTool({
538
- name: "seastudio-file_batch_flatten_preview",
539
- description: "\u9884\u89C8\u6587\u4EF6\u5939\u5185\u6240\u6709\u6587\u4EF6\uFF08\u7528\u4E8E\u6279\u91CF\u5E73\u94FA\u590D\u5236\uFF09\u3002\u8DEF\u5F84\u7EDF\u4E00\u4F7F\u7528 rootId + path\u3002",
540
- inputSchema: {
541
- type: "object",
542
- properties: {
543
- sourceRootId: { type: "string", description: "\u6E90\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
544
- sourcePath: { type: "string", description: "\u6E90\u76EE\u5F55\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E sourceRootId\uFF09" }
545
- },
546
- required: ["sourceRootId", "sourcePath"]
547
- }
548
- }, {
549
- operationKind: "read",
550
- requiresExecutionEvidence: false,
551
- rawDomain: "workspace"
552
- }),
553
- annotateTool({
554
- name: "seastudio-file_batch_flatten_copy",
555
- description: "\u6279\u91CF\u5E73\u94FA\u590D\u5236\u6587\u4EF6\u5939\u5185\u6240\u6709\u6587\u4EF6\u5230\u76EE\u6807\u76EE\u5F55\u3002\u8DEF\u5F84\u7EDF\u4E00\u4F7F\u7528 rootId + path\u3002",
556
- inputSchema: {
557
- type: "object",
558
- properties: {
559
- sourceRootId: { type: "string", description: "\u6E90\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
560
- sourcePath: { type: "string", description: "\u6E90\u76EE\u5F55\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E sourceRootId\uFF09" },
561
- destRootId: { type: "string", description: "\u76EE\u6807\u9879\u76EE\u6839\uFF1A'workspace' \u8868\u793A\u5F53\u524D\u6FC0\u6D3B\u9879\u76EE\uFF1B'proj-<projectId>' \u8868\u793A\u6309 id \u5BFB\u5740\u67D0\u4E2A\u9879\u76EE" },
562
- destPath: { type: "string", description: "\u76EE\u6807\u76EE\u5F55\u8DEF\u5F84\uFF08\u76F8\u5BF9\u4E8E destRootId\uFF09" },
563
- taskId: { type: "string", description: "\u4EFB\u52A1 ID\uFF08\u7528\u4E8E\u8FDB\u5EA6\u901A\u77E5\uFF09" }
564
- },
565
- required: ["sourceRootId", "sourcePath", "destRootId", "destPath"]
566
- }
567
- }, {
568
- operationKind: "mutate",
569
- requiresExecutionEvidence: true,
570
- rawDomain: "workspace"
571
- }, batchFlattenCopyEvidenceOutputSchema)
572
- ];
573
-
574
- // src/mcp/seastudio/tools-shell.ts
575
- var sessionSnapshotSchema = shellSessionSnapshotEvidenceOutputSchema;
576
- var shellTools = [
577
- annotateTool({
578
- name: "seastudio-shell_session_open",
579
- description: "\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u5E38\u9A7B PTY shell \u4F1A\u8BDD\uFF0C\u8FD4\u56DE sessionId\u3002\u7528\u4E8E\u540E\u7EED session_run \u5199\u5165\u547D\u4EE4\u3002 \u591A\u4E2A session \u4E4B\u95F4\u4E92\u76F8\u72EC\u7ACB\uFF0C\u957F\u4EFB\u52A1\uFF08\u5982 dev server\uFF09\u5929\u7136\u5B58\u6D3B\u76F4\u5230\u663E\u5F0F close\u3002",
580
- inputSchema: {
581
- type: "object",
582
- properties: {
583
- shell: {
584
- type: "string",
585
- enum: ["auto", "bash", "pwsh", "cmd", "sh"],
586
- description: "shell \u7C7B\u578B\uFF0C\u9ED8\u8BA4 auto\uFF08Win\u2192pwsh\uFF0CPOSIX\u2192bash\uFF09"
587
- },
588
- cwd: { type: "string", description: "\u5DE5\u4F5C\u76EE\u5F55\uFF08\u7EDD\u5BF9\u8DEF\u5F84\uFF0C\u9ED8\u8BA4\u4E3A\u9879\u76EE\u6839\u76EE\u5F55\uFF09" },
589
- env: {
590
- type: "object",
591
- description: "\u9644\u52A0\u73AF\u5883\u53D8\u91CF\uFF08\u4EC5\u5141\u8BB8\u5927\u5199\u5B57\u6BCD/\u4E0B\u5212\u7EBF\u5F00\u5934\u7684 key\uFF09",
592
- additionalProperties: { type: "string" }
593
- },
594
- label: { type: "string", description: "\u4F1A\u8BDD\u5907\u6CE8\uFF08\u4EC5\u7528\u4E8E\u663E\u793A\uFF09" },
595
- cols: { type: "number", description: "PTY \u5217\u6570\uFF08\u9ED8\u8BA4 120\uFF09" },
596
- rows: { type: "number", description: "PTY \u884C\u6570\uFF08\u9ED8\u8BA4 30\uFF09" }
597
- }
598
- }
599
- }, {
600
- operationKind: "mutate",
601
- requiresExecutionEvidence: true,
602
- rawDomain: "shell"
603
- }, shellSessionOpenEvidenceOutputSchema),
604
- annotateTool({
605
- name: "seastudio-shell_session_list",
606
- description: "\u5217\u51FA\u5F53\u524D\u6240\u6709 PTY shell \u4F1A\u8BDD\u7684\u5FEB\u7167\u3002",
607
- inputSchema: {
608
- type: "object",
609
- properties: {}
610
- }
611
- }, {
612
- operationKind: "read",
613
- requiresExecutionEvidence: false,
614
- rawDomain: "shell"
615
- }, {
616
- type: "object",
617
- properties: {
618
- sessions: {
619
- type: "array",
620
- items: sessionSnapshotSchema
621
- }
622
- },
623
- required: ["sessions"]
624
- }),
625
- annotateTool({
626
- name: "seastudio-shell_session_get",
627
- description: "\u83B7\u53D6\u6307\u5B9A session \u7684\u5F53\u524D\u5FEB\u7167\uFF08pending\u3001\u6700\u8FD1\u4E00\u6B21\u547D\u4EE4\u7B49\uFF09\u3002",
628
- inputSchema: {
629
- type: "object",
630
- properties: {
631
- sessionId: { type: "string", description: "session_open \u8FD4\u56DE\u7684 sessionId" }
632
- },
633
- required: ["sessionId"]
634
- }
635
- }, {
636
- operationKind: "read",
637
- requiresExecutionEvidence: false,
638
- rawDomain: "shell"
639
- }, sessionSnapshotSchema),
640
- annotateTool({
641
- name: "seastudio-shell_session_run",
642
- description: "\u5728\u6307\u5B9A session \u4E2D\u5199\u5165\u547D\u4EE4\u5E76\u7ACB\u5373\u8FD4\u56DE commandId\uFF08\u4E0D\u963B\u585E\uFF09\u3002 \u4F7F\u7528 session_wait \u7B49\u5F85\u547D\u4EE4\u7ED3\u675F\uFF0C\u6216 session_get_entries \u589E\u91CF\u8BFB\u53D6\u6D41\u5F0F\u8F93\u51FA\u3002 \u540C\u4E00 session \u540C\u4E00\u65F6\u523B\u53EA\u80FD\u6709\u4E00\u6761 pending \u547D\u4EE4\uFF1B\u5982\u9700\u4E2D\u65AD\u8BF7\u8C03\u7528 session_signal\u3002",
643
- inputSchema: {
644
- type: "object",
645
- properties: {
646
- sessionId: { type: "string" },
647
- command: { type: "string", description: "\u8981\u6267\u884C\u7684 shell \u547D\u4EE4" },
648
- timeoutMs: {
649
- type: "number",
650
- description: "\u53EF\u9009\u8D85\u65F6\uFF08\u6BEB\u79D2\uFF09\u3002\u8D85\u65F6\u540E\u81EA\u52A8\u5411 session \u53D1 INT\uFF0C\u4F46\u4E0D\u6740 session \u672C\u8EAB\u3002"
651
- }
652
- },
653
- required: ["sessionId", "command"]
654
- }
655
- }, {
656
- operationKind: "mutate",
657
- requiresExecutionEvidence: true,
658
- rawDomain: "shell"
659
- }, shellSessionRunEvidenceOutputSchema),
660
- annotateTool({
661
- name: "seastudio-shell_session_wait",
662
- description: "\u7B49\u5F85\u6307\u5B9A commandId \u7ED3\u675F\u5E76\u8FD4\u56DE exitCode \u7B49\u4FE1\u606F\u3002 \u82E5\u63D0\u4F9B timeoutMs \u4E14\u8D85\u65F6\uFF0C\u5219\u8FD4\u56DE finished=false / timedOut=true\uFF0C\u4F46\u4E0D\u4F1A\u4E2D\u65AD\u547D\u4EE4\u3002",
663
- inputSchema: {
664
- type: "object",
665
- properties: {
666
- sessionId: { type: "string" },
667
- commandId: { type: "string" },
668
- timeoutMs: { type: "number", description: "\u53EF\u9009\u7B49\u5F85\u8D85\u65F6\uFF08\u6BEB\u79D2\uFF09" }
669
- },
670
- required: ["sessionId", "commandId"]
671
- }
672
- }, {
673
- operationKind: "read",
674
- requiresExecutionEvidence: false,
675
- rawDomain: "shell"
676
- }, {
677
- type: "object",
678
- properties: {
679
- commandId: { type: "string" },
680
- exitCode: { type: "number" },
681
- durationMs: { type: "number" },
682
- finished: { type: "boolean" },
683
- timedOut: { type: "boolean" }
684
- },
685
- required: ["commandId", "durationMs", "finished", "timedOut"]
686
- }),
687
- annotateTool({
688
- name: "seastudio-shell_session_get_entries",
689
- description: "\u589E\u91CF\u8BFB\u53D6 session \u7684\u8F93\u51FA\u6D41\u3002\u4F20\u5165 sinceId \u4EC5\u8FD4\u56DE\u66F4\u65B0\u90E8\u5206\uFF1B\u8FD4\u56DE nextSinceId \u7528\u4E8E\u4E0B\u4E00\u6B21\u8F6E\u8BE2\u3002 \u73AF\u5F62\u7F13\u51B2\u8D85\u51FA\u4E0A\u9650\u4F1A\u4E22\u5F03\u65E7 entries \u5E76\u7D2F\u52A0 droppedCount\u3002",
690
- inputSchema: {
691
- type: "object",
692
- properties: {
693
- sessionId: { type: "string" },
694
- sinceId: { type: "number", description: "\u53EA\u8FD4\u56DE id > sinceId \u7684 entries\uFF08\u9ED8\u8BA4 0\uFF09" },
695
- limit: { type: "number", description: "\u672C\u6B21\u6700\u591A\u8FD4\u56DE\u591A\u5C11\u6761\uFF08\u9ED8\u8BA4\u65E0\u9650\u5236\uFF0C\u53D7\u7F13\u51B2\u4E0A\u9650\u5236\u7EA6\uFF09" }
696
- },
697
- required: ["sessionId"]
698
- }
699
- }, {
700
- operationKind: "read",
701
- requiresExecutionEvidence: false,
702
- rawDomain: "shell"
703
- }, {
704
- type: "object",
705
- properties: {
706
- entries: {
707
- type: "array",
708
- items: {
709
- type: "object",
710
- properties: {
711
- id: { type: "number" },
712
- level: { type: "string", enum: ["command", "stdout", "meta", "exit"] },
713
- content: { type: "string" },
714
- createdAt: { type: "number" },
715
- commandId: { type: "string" }
716
- },
717
- required: ["id", "level", "content", "createdAt"]
718
- }
719
- },
720
- nextSinceId: { type: "number" },
721
- totalEntries: { type: "number" },
722
- droppedCount: { type: "number" }
723
- },
724
- required: ["entries", "nextSinceId", "totalEntries", "droppedCount"]
725
- }),
726
- annotateTool({
727
- name: "seastudio-shell_session_signal",
728
- description: "\u5411 session \u53D1\u4FE1\u53F7\uFF1AINT \u7B49\u4EF7 Ctrl-C\uFF08\u4E0D\u6740 session\uFF09\uFF1BTERM/KILL \u6740\u6389 session \u672C\u8EAB\u3002",
729
- inputSchema: {
730
- type: "object",
731
- properties: {
732
- sessionId: { type: "string" },
733
- signal: { type: "string", enum: ["INT", "TERM", "KILL"] },
734
- commandId: {
735
- type: "string",
736
- description: "\u53EF\u9009\uFF0C\u4EC5\u8BB0\u5F55\u5728 entries \u4E2D\uFF0C\u4E0D\u5F71\u54CD\u4FE1\u53F7\u8BED\u4E49"
737
- }
738
- },
739
- required: ["sessionId", "signal"]
740
- }
741
- }, {
742
- operationKind: "mutate",
743
- requiresExecutionEvidence: true,
744
- rawDomain: "shell"
745
- }, shellSessionSignalEvidenceOutputSchema),
746
- annotateTool({
747
- name: "seastudio-shell_session_clear_entries",
748
- description: "\u6E05\u7A7A session \u7684\u8F93\u51FA\u7F13\u51B2\uFF0C\u4F1A\u8BDD\u672C\u8EAB\u4E0D\u53D7\u5F71\u54CD\u3002",
749
- inputSchema: {
750
- type: "object",
751
- properties: {
752
- sessionId: { type: "string" }
753
- },
754
- required: ["sessionId"]
755
- }
756
- }, {
757
- operationKind: "mutate",
758
- requiresExecutionEvidence: true,
759
- rawDomain: "shell"
760
- }, sessionSnapshotSchema),
761
- annotateTool({
762
- name: "seastudio-shell_session_close",
763
- description: "\u5173\u95ED session \u5E76\u91CA\u653E PTY\u3002force=true \u65F6\u4F7F\u7528 SIGKILL\uFF1B\u9ED8\u8BA4 SIGTERM\u3002",
764
- inputSchema: {
765
- type: "object",
766
- properties: {
767
- sessionId: { type: "string" },
768
- force: { type: "boolean", description: "\u5F3A\u5236 KILL\uFF0C\u9ED8\u8BA4 false" }
769
- },
770
- required: ["sessionId"]
771
- }
772
- }, {
773
- operationKind: "mutate",
774
- requiresExecutionEvidence: true,
775
- rawDomain: "shell"
776
- }, shellSessionCloseEvidenceOutputSchema)
777
- ];
778
-
779
- // src/mcp/seastudio/tools-aigc.ts
780
- var seaCloudTools = [
781
- annotateTool({
782
- name: "seastudio-seacloud_list_models",
783
- description: "\u5217\u51FA SeaCloud \u63A8\u7406\u7F51\u5173\u53EF\u7528\u7684\u591A\u6A21\u6001\u751F\u6210\u6A21\u578B\u53CA\u5176\u53C2\u6570 schema\u3002\u53EF\u6309 tag \u8FC7\u6EE4\uFF08\u5982 vidu\u3001tencent\u3001musicfy \u7B49\uFF09\u3002\u8FD4\u56DE\u6BCF\u4E2A\u6A21\u578B\u7684\u540D\u79F0\u3001\u6807\u7B7E\u548C\u53EF\u7528\u7684 body \u53C2\u6570\u5B9A\u4E49\u3002",
784
- inputSchema: {
785
- type: "object",
786
- properties: {
787
- tag: { type: "string", description: '\u6309\u6807\u7B7E\u8FC7\u6EE4\u6A21\u578B\uFF08\u53EF\u9009\uFF09\uFF0C\u5982 "vidu"\u3001"musicfy"\u3001"tencent" \u7B49' }
788
- }
789
- }
790
- }, {
791
- operationKind: "read",
792
- requiresExecutionEvidence: false,
793
- rawDomain: "asset"
794
- }),
795
- annotateTool({
796
- name: "seastudio-seacloud_create_task",
797
- description: "\u901A\u8FC7 SeaCloud \u63A8\u7406\u7F51\u5173\u521B\u5EFA\u591A\u6A21\u6001\u751F\u6210\u4EFB\u52A1\u3002\u9700\u6307\u5B9A\u6A21\u578B\u540D\u79F0\u548C\u5BF9\u5E94\u53C2\u6570\uFF0C\u53C2\u6570\u683C\u5F0F\u53C2\u7167 list_models \u8FD4\u56DE\u7684 schema\u3002\u8FD4\u56DE task_id \u7528\u4E8E\u540E\u7EED\u67E5\u8BE2\u3002",
798
- inputSchema: {
799
- type: "object",
800
- properties: {
801
- model: { type: "string", description: "\u6A21\u578B\u540D\u79F0\uFF08\u6765\u81EA list_models \u8FD4\u56DE\u7684 model \u5B57\u6BB5\uFF09" },
802
- params: { type: "object", description: "\u6A21\u578B\u53C2\u6570\uFF08\u6765\u81EA list_models \u8FD4\u56DE\u7684\u53C2\u6570 schema\uFF09" },
803
- dash_scope: { type: "boolean", description: "\u662F\u5426\u89E3\u9664\u533A\u57DF\u9650\u5236\uFF0C\u9ED8\u8BA4 true" },
804
- moderation: { type: "boolean", description: "\u662F\u5426\u89E3\u9664\u529F\u80FD\u9650\u5236\uFF0C\u9ED8\u8BA4 false" }
805
- },
806
- required: ["model", "params"]
807
- }
808
- }, {
809
- operationKind: "mutate",
810
- requiresExecutionEvidence: false,
811
- rawDomain: "asset"
812
- }),
813
- annotateTool({
814
- name: "seastudio-seacloud_query_task",
815
- description: '\u67E5\u8BE2 SeaCloud \u751F\u6210\u4EFB\u52A1\u7684\u72B6\u6001\u548C\u7ED3\u679C\u3002status \u4E3A "completed" \u65F6 output \u4E2D\u5305\u542B\u751F\u6210\u7684\u8D44\u6E90 URL\uFF0C"in_progress" \u8868\u793A\u4ECD\u5728\u5904\u7406\uFF0C"failed" \u8868\u793A\u5931\u8D25\u3002',
816
- inputSchema: {
817
- type: "object",
818
- properties: {
819
- task_id: { type: "string", description: "\u4EFB\u52A1 ID\uFF08\u7531 create_task \u8FD4\u56DE\uFF09" }
820
- },
821
- required: ["task_id"]
822
- }
823
- }, {
824
- operationKind: "read",
825
- requiresExecutionEvidence: false,
826
- rawDomain: "asset"
827
- })
828
- ];
829
-
830
- // src/mcp/seastudio/client.ts
831
- function parseToolResult(result) {
832
- if (result.isError) {
833
- const message = result.content.find((entry) => entry.type === "text")?.text ?? "MCP tool failed";
834
- throw new Error(message);
835
- }
836
- if (result.structuredContent !== void 0) {
837
- return result.structuredContent;
838
- }
839
- const text = result.content.find((entry) => entry.type === "text")?.text;
840
- return text ? JSON.parse(text) : {};
841
- }
842
- async function callTool(name, args = {}) {
843
- return getDefaultClient().callTool(name, args);
844
- }
845
- async function request(method, params) {
846
- return getDefaultClient().request(method, params);
847
- }
848
- async function callToolText(name, args = {}) {
849
- return getDefaultClient().callToolText(name, args);
850
- }
851
- function usesAbsolutePathMode(mode) {
852
- return mode === "absolute";
853
- }
854
- function getPathBasename(path) {
855
- const trimmed = path.replace(/[\\/]+$/g, "");
856
- if (!trimmed) return "";
857
- const parts = trimmed.split(/[\\/]/).filter(Boolean);
858
- return parts[parts.length - 1] ?? "";
859
- }
860
- function joinWorkspacePath(dir, name) {
861
- const normalizedDir = dir.replace(/\\/g, "/").replace(/\/+$/g, "");
862
- const normalizedName = name.replace(/^\/+/g, "");
863
- return normalizedDir ? `${normalizedDir}/${normalizedName}` : normalizedName;
864
- }
865
- var seastudio = {
866
- roots: {
867
- list: () => request("roots/list")
868
- },
869
- project: {
870
- list: () => callTool("seastudio-project_list", {}),
871
- getActive: () => callTool("seastudio-project_get_active", {})
872
- },
873
- file: {
874
- getSelected: () => callTool("seastudio-file_get_selected", {}),
875
- read: (path, options) => callTool("seastudio-file_read", {
876
- rootId: options?.rootId ?? "workspace",
877
- path,
878
- ...typeof options?.encoding === "string" ? { encoding: options.encoding } : {},
879
- ...typeof options?.offset === "number" ? { offset: options.offset } : {},
880
- ...typeof options?.limit === "number" ? { limit: options.limit } : {}
881
- }),
882
- write: (path, content, options) => callTool("seastudio-file_write", { rootId: options?.rootId ?? "workspace", path, content }),
883
- list: (path = "", options) => callTool("seastudio-file_list", {
884
- rootId: options?.rootId ?? "workspace",
885
- path
886
- }),
887
- tree: (path = "", options) => callTool("seastudio-file_tree", {
888
- rootId: options?.rootId ?? "workspace",
889
- path,
890
- ...typeof options?.maxDepth === "number" ? { maxDepth: options.maxDepth } : {},
891
- ...typeof options?.maxEntries === "number" ? { maxEntries: options.maxEntries } : {}
892
- }),
893
- delete: (path, options) => callTool("seastudio-file_delete", { rootId: options?.rootId ?? "workspace", path }),
894
- mkdir: (path, options) => callTool("seastudio-file_mkdir", { rootId: options?.rootId ?? "workspace", path }),
895
- exists: (path, options) => callTool("seastudio-file_exists", { rootId: options?.rootId ?? "workspace", path }),
896
- stat: (path, options) => callTool("seastudio-file_stat", {
897
- rootId: options?.rootId ?? "workspace",
898
- path
899
- }),
900
- info: (path, options) => callTool("seastudio-file_info", {
901
- rootId: options?.rootId ?? "workspace",
902
- path
903
- }),
904
- search: (query, options) => callTool("seastudio-file_search", {
905
- query,
906
- rootId: options?.rootId ?? "workspace",
907
- path: options?.path ?? "",
908
- ...options?.glob ? { glob: options.glob } : {},
909
- ...typeof options?.headLimit === "number" ? { headLimit: options.headLimit } : {}
910
- }),
911
- codeSearch: (pattern, path, glob, headLimit) => callTool("seastudio-code_search", { pattern, path, glob, headLimit }),
912
- rename: (path, newName, options) => callTool("seastudio-file_rename", { rootId: options?.rootId ?? "workspace", path, newName }),
913
- move: (sourcePath, destDir, options) => {
914
- if (usesAbsolutePathMode(options?.sourcePathMode) || usesAbsolutePathMode(options?.destPathMode)) {
915
- return callTool("seastudio-file_move", { sourcePath, destDir, ...options });
916
- }
917
- const srcRoot = options?.sourceRootId ?? "workspace";
918
- const dstRoot = options?.destRootId ?? srcRoot;
919
- return callTool("seastudio-file_move", {
920
- sourceRootId: srcRoot,
921
- sourcePath,
922
- destRootId: dstRoot,
923
- destPath: joinWorkspacePath(destDir, getPathBasename(sourcePath))
924
- });
925
- },
926
- copyTo: (sourcePath, destDir, options) => {
927
- if (usesAbsolutePathMode(options?.sourcePathMode) || usesAbsolutePathMode(options?.destPathMode)) {
928
- return callTool("seastudio-file_copy_to", { sourcePath, destDir, ...options });
929
- }
930
- const srcRoot = options?.sourceRootId ?? "workspace";
931
- const dstRoot = options?.destRootId ?? srcRoot;
932
- return callTool("seastudio-file_copy_to", {
933
- sourceRootId: srcRoot,
934
- sourcePath,
935
- destRootId: dstRoot,
936
- destPath: joinWorkspacePath(destDir, getPathBasename(sourcePath))
937
- });
938
- },
939
- copy: (path, options) => callTool("seastudio-file_copy", { rootId: options?.rootId ?? "workspace", path }),
940
- paste: (path = "", options) => callTool("seastudio-file_paste", { rootId: options?.rootId ?? "workspace", path }),
941
- clipboardCheck: () => callTool("seastudio-file_clipboard_check", {}),
942
- copyPath: (path, options) => callTool("seastudio-file_copy_path", { rootId: options?.rootId ?? "workspace", path }),
943
- trash: (path, options) => callTool("seastudio-file_trash", { rootId: options?.rootId ?? "workspace", path }),
944
- batchFlattenPreview: (sourcePath, options) => {
945
- if (usesAbsolutePathMode(options?.sourcePathMode)) {
946
- return callTool("seastudio-file_batch_flatten_preview", { sourcePath, ...options });
947
- }
948
- return callTool("seastudio-file_batch_flatten_preview", {
949
- sourceRootId: options?.sourceRootId ?? "workspace",
950
- sourcePath
951
- });
952
- },
953
- batchFlattenCopy: (sourcePath, destDir, taskId, options) => {
954
- if (usesAbsolutePathMode(options?.sourcePathMode) || usesAbsolutePathMode(options?.destPathMode)) {
955
- return callTool("seastudio-file_batch_flatten_copy", { sourcePath, destDir, taskId, ...options });
956
- }
957
- const srcRoot = options?.sourceRootId ?? "workspace";
958
- const dstRoot = options?.destRootId ?? srcRoot;
959
- return callTool("seastudio-file_batch_flatten_copy", {
960
- sourceRootId: srcRoot,
961
- sourcePath,
962
- destRootId: dstRoot,
963
- destPath: destDir,
964
- ...typeof taskId === "string" ? { taskId } : {}
965
- });
966
- },
967
- getUrl: (path, options) => callTool("seastudio-file_get_url", { rootId: options?.rootId ?? "workspace", path }),
968
- download: (url, path, filenameHint, options) => {
969
- const absoluteDir = options?.absoluteDir?.trim();
970
- if (absoluteDir) {
971
- return callTool("seastudio-file_download", { url, absoluteDir, filenameHint });
972
- }
973
- return callTool("seastudio-file_download", { rootId: options?.rootId ?? "workspace", path, url, filenameHint });
974
- },
975
- writeBinary: (path, base64, options) => callTool("seastudio-file_write_binary", { rootId: options?.rootId ?? "workspace", path, base64 }),
976
- readBinary: (path, options) => callTool("seastudio-file_read_binary", { rootId: options?.rootId ?? "workspace", path })
977
- },
978
- shell: {
979
- session: {
980
- open: (options = {}) => callTool("seastudio-shell_session_open", { ...options }),
981
- list: () => callTool("seastudio-shell_session_list", {}),
982
- get: (sessionId) => callTool("seastudio-shell_session_get", { sessionId }),
983
- run: (sessionId, command, options = {}) => callTool("seastudio-shell_session_run", {
984
- sessionId,
985
- command,
986
- ...typeof options.timeoutMs === "number" ? { timeoutMs: options.timeoutMs } : {}
987
- }),
988
- wait: (sessionId, commandId, timeoutMs) => callTool("seastudio-shell_session_wait", {
989
- sessionId,
990
- commandId,
991
- ...typeof timeoutMs === "number" ? { timeoutMs } : {}
992
- }),
993
- getEntries: (sessionId, options = {}) => callTool("seastudio-shell_session_get_entries", {
994
- sessionId,
995
- ...typeof options.sinceId === "number" ? { sinceId: options.sinceId } : {},
996
- ...typeof options.limit === "number" ? { limit: options.limit } : {}
997
- }),
998
- signal: (sessionId, signal, commandId) => callTool("seastudio-shell_session_signal", {
999
- sessionId,
1000
- signal,
1001
- ...commandId ? { commandId } : {}
1002
- }),
1003
- clearEntries: (sessionId) => callTool("seastudio-shell_session_clear_entries", { sessionId }),
1004
- close: (sessionId, force = false) => callTool("seastudio-shell_session_close", { sessionId, force })
1005
- }
1006
- },
1007
- browser: {
1008
- session: {
1009
- open: async (options = {}) => parseToolResult(await callTool("seastudio-browser_session_open", { ...options })),
1010
- list: async () => parseToolResult(await callTool("seastudio-browser_session_list")),
1011
- get: async (browserSessionId) => parseToolResult(await callTool("seastudio-browser_session_get", { browserSessionId })),
1012
- close: async (browserSessionId) => parseToolResult(
1013
- await callTool("seastudio-browser_session_close", { browserSessionId })
1014
- )
1015
- },
1016
- tab: {
1017
- create: async (browserSessionId, url) => parseToolResult(
1018
- await callTool("seastudio-browser_tab_create", { browserSessionId, url })
1019
- ),
1020
- close: async (browserSessionId, tabId) => parseToolResult(
1021
- await callTool("seastudio-browser_tab_close", { browserSessionId, tabId })
1022
- ),
1023
- activate: async (browserSessionId, tabId) => parseToolResult(
1024
- await callTool("seastudio-browser_tab_activate", { browserSessionId, tabId })
1025
- ),
1026
- navigate: async (browserSessionId, tabId, url) => parseToolResult(
1027
- await callTool("seastudio-browser_tab_navigate", { browserSessionId, tabId, url })
1028
- ),
1029
- goBack: async (browserSessionId, tabId) => parseToolResult(await callTool("seastudio-browser_tab_go_back", { browserSessionId, tabId })),
1030
- goForward: async (browserSessionId, tabId) => parseToolResult(await callTool("seastudio-browser_tab_go_forward", { browserSessionId, tabId })),
1031
- reload: async (browserSessionId, tabId) => parseToolResult(await callTool("seastudio-browser_tab_reload", { browserSessionId, tabId })),
1032
- stop: async (browserSessionId, tabId) => parseToolResult(await callTool("seastudio-browser_tab_stop", { browserSessionId, tabId }))
1033
- },
1034
- viewport: {
1035
- bind: async (browserSessionId, rect, ownerInstanceId) => parseToolResult(
1036
- await callTool("seastudio-browser_viewport_bind", {
1037
- browserSessionId,
1038
- rect,
1039
- ...ownerInstanceId ? { ownerInstanceId } : {}
1040
- })
1041
- )
1042
- },
1043
- certificate: {
1044
- respond: async (browserSessionId, requestId, allow) => parseToolResult(
1045
- await callTool("seastudio-browser_certificate_respond", { browserSessionId, requestId, allow })
1046
- )
1047
- }
1048
- }
1049
- };
1050
- async function runOneShotShellCommand(command, options = {}) {
1051
- const { timeoutMs, ...openOpts } = options;
1052
- const openRaw = await seastudio.shell.session.open(openOpts);
1053
- const openText = openRaw.content?.[0]?.text ?? "{}";
1054
- const opened = JSON.parse(openText);
1055
- const sessionId = opened.sessionId;
1056
- if (!sessionId) {
1057
- throw new Error("shell_session_open did not return sessionId");
1058
- }
1059
- try {
1060
- const runRaw = await seastudio.shell.session.run(sessionId, command, {
1061
- ...typeof timeoutMs === "number" ? { timeoutMs } : {}
1062
- });
1063
- const runText = runRaw.content?.[0]?.text ?? "{}";
1064
- const run = JSON.parse(runText);
1065
- const waitRaw = await seastudio.shell.session.wait(
1066
- sessionId,
1067
- run.commandId,
1068
- typeof timeoutMs === "number" ? timeoutMs + 5e3 : void 0
1069
- );
1070
- const waitText = waitRaw.content?.[0]?.text ?? "{}";
1071
- const wait = JSON.parse(waitText);
1072
- const entriesRaw = await seastudio.shell.session.getEntries(sessionId, {});
1073
- const entriesText = entriesRaw.content?.[0]?.text ?? "{}";
1074
- const entries = JSON.parse(entriesText);
1075
- const stdout = entries.entries.filter((e) => e.commandId === run.commandId && e.level === "stdout").map((e) => e.content).join("\n");
1076
- return {
1077
- exitCode: wait.exitCode,
1078
- stdout,
1079
- durationMs: wait.durationMs,
1080
- timedOut: wait.timedOut
1081
- };
1082
- } finally {
1083
- try {
1084
- await seastudio.shell.session.close(sessionId);
1085
- } catch {
1086
- }
1087
- }
1088
- }
1089
-
1090
- // src/mcp/seastudio/tools-plugin.ts
1091
- var pluginManagementTools = [
1092
- annotateTool({
1093
- name: "seastudio-plugin_list_official",
1094
- description: "\u5217\u51FA Registry \u4E2D\u6240\u6709\u5B98\u65B9\u63D2\u4EF6\u3002\u8FD4\u56DE\u6BCF\u4E2A\u63D2\u4EF6\u7684 id\u3001name\u3001version\u3001description \u7B49\u4FE1\u606F\u3002",
1095
- inputSchema: {
1096
- type: "object",
1097
- properties: {}
1098
- }
1099
- }, {
1100
- operationKind: "read",
1101
- requiresExecutionEvidence: false
1102
- }),
1103
- annotateTool({
1104
- name: "seastudio-plugin_list_installed",
1105
- description: "\u5217\u51FA\u672C\u5730\u5DF2\u5B89\u88C5\u7684\u6240\u6709\u63D2\u4EF6\u3002\u8FD4\u56DE\u6BCF\u4E2A\u63D2\u4EF6\u7684 id\u3001name\u3001version\u3001enabled \u72B6\u6001\u7B49\u3002",
1106
- inputSchema: {
1107
- type: "object",
1108
- properties: {}
1109
- }
1110
- }, {
1111
- operationKind: "read",
1112
- requiresExecutionEvidence: false
1113
- }),
1114
- annotateTool({
1115
- name: "seastudio-plugin_install",
1116
- description: "\u4ECE Registry \u5B89\u88C5\u6307\u5B9A\u63D2\u4EF6\u3002\u9700\u63D0\u4F9B\u63D2\u4EF6 id\uFF0C\u7CFB\u7EDF\u4F1A\u4ECE\u5B98\u65B9 Registry \u4E0B\u8F7D\u5E76\u5B89\u88C5\u3002",
1117
- inputSchema: {
1118
- type: "object",
1119
- properties: {
1120
- pluginId: { type: "string", description: "\u8981\u5B89\u88C5\u7684\u63D2\u4EF6 ID" }
1121
- },
1122
- required: ["pluginId"]
1123
- }
1124
- }, {
1125
- operationKind: "mutate",
1126
- requiresExecutionEvidence: true
1127
- }),
1128
- annotateTool({
1129
- name: "seastudio-plugin_uninstall",
1130
- description: "\u5378\u8F7D\u6307\u5B9A\u63D2\u4EF6\u3002\u9700\u63D0\u4F9B\u63D2\u4EF6 id\u3002",
1131
- inputSchema: {
1132
- type: "object",
1133
- properties: {
1134
- pluginId: { type: "string", description: "\u8981\u5378\u8F7D\u7684\u63D2\u4EF6 ID" }
1135
- },
1136
- required: ["pluginId"]
1137
- }
1138
- }, {
1139
- operationKind: "mutate",
1140
- requiresExecutionEvidence: true
1141
- }),
1142
- annotateTool({
1143
- name: "seastudio-plugin_get_status",
1144
- description: "\u83B7\u53D6\u6307\u5B9A\u63D2\u4EF6\u7684\u5B89\u88C5\u72B6\u6001\u3002\u8FD4\u56DE\u662F\u5426\u5DF2\u5B89\u88C5\u3001\u7248\u672C\u3001UI \u7C7B\u578B\u7B49\u8BE6\u7EC6\u4FE1\u606F\u3002\u82E5\u672A\u5B89\u88C5\u5219\u68C0\u67E5 Registry \u4E2D\u662F\u5426\u5B58\u5728\u3002",
1145
- inputSchema: {
1146
- type: "object",
1147
- properties: {
1148
- pluginId: { type: "string", description: "\u8981\u67E5\u8BE2\u7684\u63D2\u4EF6 ID" }
1149
- },
1150
- required: ["pluginId"]
1151
- }
1152
- }, {
1153
- operationKind: "read",
1154
- requiresExecutionEvidence: false
1155
- })
1156
- ];
1157
- var pluginTabTools = [
1158
- annotateTool({
1159
- name: "seastudio-plugin_tab_list",
1160
- description: "\u83B7\u53D6\u5F53\u524D\u6240\u6709\u6253\u5F00\u7684\u63D2\u4EF6\u6807\u7B7E\u9875\u3002\u8FD4\u56DE\u6BCF\u4E2A\u6807\u7B7E\u7684 instanceId\u3001pluginId\u3001title \u7B49\u3002",
1161
- inputSchema: {
1162
- type: "object",
1163
- properties: {}
1164
- }
1165
- }, {
1166
- operationKind: "read",
1167
- requiresExecutionEvidence: false
1168
- }),
1169
- annotateTool({
1170
- name: "seastudio-plugin_tab_get_active",
1171
- description: "\u83B7\u53D6\u5F53\u524D\u805A\u7126\uFF08\u6FC0\u6D3B\uFF09\u7684\u63D2\u4EF6\u6807\u7B7E\u9875\u3002\u8FD4\u56DE\u8BE5\u6807\u7B7E\u7684 instanceId\u3001pluginId\u3001title\u3002",
1172
- inputSchema: {
1173
- type: "object",
1174
- properties: {}
1175
- }
1176
- }, {
1177
- operationKind: "read",
1178
- requiresExecutionEvidence: false
1179
- }),
1180
- annotateTool({
1181
- name: "seastudio-plugin_tab_open",
1182
- description: "\u4E3A\u6307\u5B9A\u63D2\u4EF6\u65B0\u5EFA\u4E00\u4E2A\u6807\u7B7E\u9875\u5E76\u6FC0\u6D3B\u3002\u9700\u63D0\u4F9B\u63D2\u4EF6 id\u3002",
1183
- inputSchema: {
1184
- type: "object",
1185
- properties: {
1186
- pluginId: { type: "string", description: "\u8981\u6253\u5F00\u6807\u7B7E\u9875\u7684\u63D2\u4EF6 ID" }
1187
- },
1188
- required: ["pluginId"]
1189
- }
1190
- }, {
1191
- operationKind: "mutate",
1192
- requiresExecutionEvidence: true
1193
- }),
1194
- annotateTool({
1195
- name: "seastudio-plugin_tab_switch",
1196
- description: "\u5207\u6362\u5230\u6307\u5B9A\u7684\u63D2\u4EF6\u6807\u7B7E\u9875\u3002\u9700\u63D0\u4F9B\u6807\u7B7E\u5B9E\u4F8B ID\uFF08instanceId\uFF09\u3002",
1197
- inputSchema: {
1198
- type: "object",
1199
- properties: {
1200
- instanceId: { type: "string", description: "\u8981\u5207\u6362\u5230\u7684\u6807\u7B7E\u5B9E\u4F8B ID" }
1201
- },
1202
- required: ["instanceId"]
1203
- }
1204
- }, {
1205
- operationKind: "mutate",
1206
- requiresExecutionEvidence: true
1207
- }),
1208
- annotateTool({
1209
- name: "seastudio-plugin_tab_close",
1210
- description: "\u5173\u95ED\u6307\u5B9A\u7684\u63D2\u4EF6\u6807\u7B7E\u9875\u3002\u9700\u63D0\u4F9B\u6807\u7B7E\u5B9E\u4F8B ID\uFF08instanceId\uFF09\u3002",
1211
- inputSchema: {
1212
- type: "object",
1213
- properties: {
1214
- instanceId: { type: "string", description: "\u8981\u5173\u95ED\u7684\u6807\u7B7E\u5B9E\u4F8B ID" }
1215
- },
1216
- required: ["instanceId"]
1217
- }
1218
- }, {
1219
- operationKind: "mutate",
1220
- requiresExecutionEvidence: true
1221
- }),
1222
- annotateTool({
1223
- name: "seastudio-plugin_tab_get_status",
1224
- description: "\u83B7\u53D6\u6307\u5B9A\u63D2\u4EF6\u7684\u6807\u7B7E\u72B6\u6001\u3002\u8FD4\u56DE\u8BE5\u63D2\u4EF6\u6253\u5F00\u4E86\u51E0\u4E2A\u6807\u7B7E\u3001\u5404\u6807\u7B7E\u7684 instanceId/title\u3001\u54EA\u4E2A\u662F\u5F53\u524D\u805A\u7126\u6001\u3002",
1225
- inputSchema: {
1226
- type: "object",
1227
- properties: {
1228
- pluginId: { type: "string", description: "\u8981\u67E5\u8BE2\u6807\u7B7E\u72B6\u6001\u7684\u63D2\u4EF6 ID" }
1229
- },
1230
- required: ["pluginId"]
1231
- }
1232
- }, {
1233
- operationKind: "read",
1234
- requiresExecutionEvidence: false
1235
- })
1236
- ];
1237
-
1238
- // src/mcp/seastudio/tools-agent.ts
1239
- var agentManagementTools = [
1240
- annotateTool({
1241
- name: "seastudio-agent_list_official",
1242
- description: "\u5217\u51FA Registry \u4E2D\u6240\u6709\u5B98\u65B9 Agent\u3002\u8FD4\u56DE\u6BCF\u4E2A Agent \u7684 id\u3001name\u3001version\u3001description \u7B49\u4FE1\u606F\u3002",
1243
- inputSchema: {
1244
- type: "object",
1245
- properties: {}
1246
- }
1247
- }, {
1248
- operationKind: "read",
1249
- requiresExecutionEvidence: false
1250
- }),
1251
- annotateTool({
1252
- name: "seastudio-agent_list_installed",
1253
- description: "\u5217\u51FA\u672C\u5730\u5DF2\u5B89\u88C5\u7684\u6240\u6709 Agent\u3002\u8FD4\u56DE\u6BCF\u4E2A Agent \u7684 id\u3001name\u3001version\u3001enabled \u72B6\u6001\u7B49\u3002",
1254
- inputSchema: {
1255
- type: "object",
1256
- properties: {}
1257
- }
1258
- }, {
1259
- operationKind: "read",
1260
- requiresExecutionEvidence: false
1261
- }),
1262
- annotateTool({
1263
- name: "seastudio-agent_install",
1264
- description: "\u4ECE Registry \u5B89\u88C5\u6307\u5B9A Agent\u3002\u9700\u63D0\u4F9B Agent id\uFF0C\u7CFB\u7EDF\u4F1A\u4ECE\u5B98\u65B9 Registry \u4E0B\u8F7D\u5E76\u5B89\u88C5\u3002",
1265
- inputSchema: {
1266
- type: "object",
1267
- properties: {
1268
- agentId: { type: "string", description: "\u8981\u5B89\u88C5\u7684 Agent ID" }
1269
- },
1270
- required: ["agentId"]
1271
- }
1272
- }, {
1273
- operationKind: "mutate",
1274
- requiresExecutionEvidence: true
1275
- }),
1276
- annotateTool({
1277
- name: "seastudio-agent_uninstall",
1278
- description: "\u5378\u8F7D\u6307\u5B9A Agent\u3002\u9700\u63D0\u4F9B Agent id\u3002",
1279
- inputSchema: {
1280
- type: "object",
1281
- properties: {
1282
- agentId: { type: "string", description: "\u8981\u5378\u8F7D\u7684 Agent ID" }
1283
- },
1284
- required: ["agentId"]
1285
- }
1286
- }, {
1287
- operationKind: "mutate",
1288
- requiresExecutionEvidence: true
1289
- }),
1290
- annotateTool({
1291
- name: "seastudio-agent_get_status",
1292
- description: "\u83B7\u53D6\u6307\u5B9A Agent \u7684\u5B89\u88C5\u72B6\u6001\u3002\u8FD4\u56DE\u662F\u5426\u5DF2\u5B89\u88C5\u3001\u7248\u672C\u3001\u540E\u7AEF\u6A21\u5F0F\u7B49\u8BE6\u7EC6\u4FE1\u606F\u3002\u82E5\u672A\u5B89\u88C5\u5219\u68C0\u67E5 Registry \u4E2D\u662F\u5426\u5B58\u5728\u3002",
1293
- inputSchema: {
1294
- type: "object",
1295
- properties: {
1296
- agentId: { type: "string", description: "\u8981\u67E5\u8BE2\u7684 Agent ID" }
1297
- },
1298
- required: ["agentId"]
1299
- }
1300
- }, {
1301
- operationKind: "read",
1302
- requiresExecutionEvidence: false
1303
- })
1304
- ];
1305
- var agentTabTools = [
1306
- annotateTool({
1307
- name: "seastudio-agent_tab_list",
1308
- description: "\u83B7\u53D6\u5F53\u524D\u6240\u6709\u6253\u5F00\u7684 Agent \u6807\u7B7E\u9875\u3002\u8FD4\u56DE\u6BCF\u4E2A\u6807\u7B7E\u7684 instanceId\u3001agentId\u3001name \u7B49\u3002",
1309
- inputSchema: {
1310
- type: "object",
1311
- properties: {}
1312
- }
1313
- }, {
1314
- operationKind: "read",
1315
- requiresExecutionEvidence: false
1316
- }),
1317
- annotateTool({
1318
- name: "seastudio-agent_tab_get_active",
1319
- description: "\u83B7\u53D6\u5F53\u524D\u805A\u7126\uFF08\u6FC0\u6D3B\uFF09\u7684 Agent \u6807\u7B7E\u9875\u3002\u8FD4\u56DE\u8BE5\u6807\u7B7E\u7684 instanceId\u3001agentId\u3001name\u3002",
1320
- inputSchema: {
1321
- type: "object",
1322
- properties: {}
1323
- }
1324
- }, {
1325
- operationKind: "read",
1326
- requiresExecutionEvidence: false
1327
- }),
1328
- annotateTool({
1329
- name: "seastudio-agent_tab_open",
1330
- description: "\u4E3A\u6307\u5B9A Agent \u65B0\u5EFA\u4E00\u4E2A\u6807\u7B7E\u9875\u5E76\u6FC0\u6D3B\u3002\u9700\u63D0\u4F9B Agent id\u3002",
1331
- inputSchema: {
1332
- type: "object",
1333
- properties: {
1334
- agentId: { type: "string", description: "\u8981\u6253\u5F00\u6807\u7B7E\u9875\u7684 Agent ID" }
1335
- },
1336
- required: ["agentId"]
1337
- }
1338
- }, {
1339
- operationKind: "mutate",
1340
- requiresExecutionEvidence: true
1341
- }),
1342
- annotateTool({
1343
- name: "seastudio-agent_tab_switch",
1344
- description: "\u5207\u6362\u5230\u6307\u5B9A\u7684 Agent \u6807\u7B7E\u9875\u3002\u9700\u63D0\u4F9B\u6807\u7B7E\u5B9E\u4F8B ID\uFF08instanceId\uFF09\u3002",
1345
- inputSchema: {
1346
- type: "object",
1347
- properties: {
1348
- instanceId: { type: "string", description: "\u8981\u5207\u6362\u5230\u7684\u6807\u7B7E\u5B9E\u4F8B ID" }
1349
- },
1350
- required: ["instanceId"]
1351
- }
1352
- }, {
1353
- operationKind: "mutate",
1354
- requiresExecutionEvidence: true
1355
- }),
1356
- annotateTool({
1357
- name: "seastudio-agent_tab_close",
1358
- description: "\u5173\u95ED\u6307\u5B9A\u7684 Agent \u6807\u7B7E\u9875\u3002\u9700\u63D0\u4F9B\u6807\u7B7E\u5B9E\u4F8B ID\uFF08instanceId\uFF09\u3002",
1359
- inputSchema: {
1360
- type: "object",
1361
- properties: {
1362
- instanceId: { type: "string", description: "\u8981\u5173\u95ED\u7684\u6807\u7B7E\u5B9E\u4F8B ID" }
1363
- },
1364
- required: ["instanceId"]
1365
- }
1366
- }, {
1367
- operationKind: "mutate",
1368
- requiresExecutionEvidence: true
1369
- }),
1370
- annotateTool({
1371
- name: "seastudio-agent_tab_get_status",
1372
- description: "\u83B7\u53D6\u6307\u5B9A Agent \u7684\u6807\u7B7E\u72B6\u6001\u3002\u8FD4\u56DE\u8BE5 Agent \u6253\u5F00\u4E86\u51E0\u4E2A\u6807\u7B7E\u3001\u5404\u6807\u7B7E\u7684 instanceId/name\u3001\u54EA\u4E2A\u662F\u5F53\u524D\u805A\u7126\u6001\u3002",
1373
- inputSchema: {
1374
- type: "object",
1375
- properties: {
1376
- agentId: { type: "string", description: "\u8981\u67E5\u8BE2\u6807\u7B7E\u72B6\u6001\u7684 Agent ID" }
1377
- },
1378
- required: ["agentId"]
1379
- }
1380
- }, {
1381
- operationKind: "read",
1382
- requiresExecutionEvidence: false
1383
- })
1384
- ];
1385
-
1386
- // src/mcp/seastudio/tools-project.ts
1387
- var projectTools = [
1388
- annotateTool({
1389
- name: "seastudio-project_list",
1390
- description: "\u5217\u51FA\u5F53\u524D\u7528\u6237\u7684\u6240\u6709\u9879\u76EE\uFF08\u6241\u5E73\u7ED3\u6784\uFF09\u3002\u8FD4\u56DE\u6BCF\u4E2A\u9879\u76EE\u7684 id\u3001name\u3001path\u3001lastActiveAt\u3001isActive\uFF0C\u4EE5\u53CA\u53EF\u76F4\u63A5\u4F20\u7ED9 file \u5DE5\u5177\u7684 rootId\uFF08\u5F62\u5982 'proj-<id>'\uFF09\u3002\u5F53\u9700\u8981\u8DE8\u9879\u76EE\u8BFB\u5199\u65F6\u5148\u8C03\u7528\u6B64\u5DE5\u5177\u3002",
1391
- inputSchema: {
1392
- type: "object",
1393
- properties: {}
1394
- }
1395
- }, {
1396
- operationKind: "read",
1397
- requiresExecutionEvidence: false
1398
- }),
1399
- annotateTool({
1400
- name: "seastudio-project_get_active",
1401
- description: "\u83B7\u53D6\u5F53\u524D MCP \u8BF7\u6C42\u4E0A\u4E0B\u6587\u6240\u5C5E\u9879\u76EE\uFF1B\u6CA1\u6709\u4E0A\u4E0B\u6587\u65F6\u56DE\u9000\u5230\u524D\u53F0\u805A\u7126\u9879\u76EE\u3002\u8FD4\u56DE\u7ED3\u6784\u4E0E seastudio-project_list \u4E2D\u5355\u9879\u4E00\u81F4\uFF1B\u82E5\u5F53\u524D\u6CA1\u6709\u9879\u76EE\u5219\u8FD4\u56DE null\u3002",
1402
- inputSchema: {
1403
- type: "object",
1404
- properties: {}
1405
- }
1406
- }, {
1407
- operationKind: "read",
1408
- requiresExecutionEvidence: false
1409
- })
1410
- ];
1411
-
1412
- // src/mcp/seastudio/tools-skill.ts
1413
- var skillTools = [
1414
- annotateTool({
1415
- name: "seastudio-skill_list",
1416
- description: "\u5217\u51FA\u5F53\u524D\u4E0A\u4E0B\u6587\u4E0B\u53EF\u7528\u7684 Agent Skill\u3002\u8FC7\u6EE4\u89C4\u5219\uFF1A\u4E0D\u4F20 projectId \u65F6\u53EA\u8FD4\u56DE\u5168\u5C40\u751F\u6548\uFF08scopes.global=true\uFF09\u7684 skill\uFF1B\u4F20 projectId \u65F6\u8FD4\u56DE\u5168\u5C40\u751F\u6548\u6216\u8BE5\u9879\u76EE\u4E13\u5C5E\u751F\u6548\uFF08scopes.projectIds \u542B\u8BE5 projectId\uFF09\u7684 skill\u3002\u7B2C\u4E09\u65B9\u6765\u6E90\uFF08claude-code/codex/cursor/custom\uFF09\u53EA\u8981\u626B\u5230\u5373\u89C6\u4E3A\u5168\u5C40\u751F\u6548\u3002\u53EF\u9009 source \u53C2\u6570\u6309\u6765\u6E90\u8FC7\u6EE4\u3002\u8FD4\u56DE\u6BCF\u9879\u542B id\u3001name\u3001description\u3001version\u3001tags\u3001source\u3001sourceLabel\u3001scopes\u3002",
1417
- inputSchema: {
1418
- type: "object",
1419
- properties: {
1420
- projectId: {
1421
- type: "string",
1422
- description: "\u53EF\u9009\uFF1A\u7528\u4E8E\u547D\u4E2D scopes.projectIds \u7684\u9879\u76EE ID\uFF08\u4E0E seastudio-project_list \u8FD4\u56DE\u7684 id \u4E00\u81F4\uFF09\u3002\u4E0D\u4F20\u5219\u53EA\u770B\u5168\u5C40\u751F\u6548\u3002"
1423
- },
1424
- source: {
1425
- type: "string",
1426
- enum: ["seastudio", "claude-code", "codex", "cursor", "custom"],
1427
- description: "\u53EF\u9009\uFF1A\u4EC5\u8FD4\u56DE\u6307\u5B9A\u6765\u6E90\u7684 skill\u3002"
1428
- }
1429
- }
1430
- }
1431
- }, {
1432
- operationKind: "read",
1433
- requiresExecutionEvidence: false,
1434
- rawDomain: "skill"
1435
- }),
1436
- annotateTool({
1437
- name: "seastudio-skill_get",
1438
- description: "\u8BFB\u53D6\u6307\u5B9A skill \u7684\u8131\u654F manifest\u3001SKILL.md \u5B8C\u6574\u5185\u5BB9\u548C\u9644\u5C5E\u6587\u4EF6\u6E05\u5355\u3002id \u53D6\u81EA seastudio-skill_list \u8FD4\u56DE\u9879\u7684 id\u3002\u53EF\u9009 projectId \u7528\u4E8E\u9650\u5B9A\u53EA\u80FD\u8BFB\u53D6\u5F53\u524D\u4F1A\u8BDD\u9879\u76EE\u53EF\u89C1\u7684 skill\uFF08\u8BE5\u9879\u76EE skill + \u5168\u5C40 skill\uFF09\u3002\u8FD4\u56DE\u5185\u5BB9\u5E94\u4F5C\u4E3A Agent Skill \u6307\u4EE4\u9075\u5FAA\u3002\u8FD4\u56DE { content: { skill, content } | null }\uFF0Cid \u4E0D\u5B58\u5728\u3001\u4E0D\u53EF\u89C1\u6216\u8BFB\u53D6\u5931\u8D25\u65F6 content \u4E3A null\u3002",
1439
- inputSchema: {
1440
- type: "object",
1441
- properties: {
1442
- id: {
1443
- type: "string",
1444
- description: 'Skill \u7684\u7A33\u5B9A id\uFF08\u5982 "seastudio:my-skill"\uFF09\uFF0C\u6765\u6E90\u4E8E seastudio-skill_list \u7684\u8FD4\u56DE\u9879\u3002'
1445
- },
1446
- projectId: {
1447
- type: "string",
1448
- description: "\u53EF\u9009\uFF1A\u5F53\u524D\u4F1A\u8BDD\u6240\u5C5E\u9879\u76EE ID\u3002\u4F20\u5165\u540E\u53EA\u5141\u8BB8\u8BFB\u53D6\u5168\u5C40 skill \u6216\u8BE5\u9879\u76EE\u53EF\u89C1\u7684 skill\u3002"
1449
- }
1450
- },
1451
- required: ["id"]
1452
- }
1453
- }, {
1454
- operationKind: "read",
1455
- requiresExecutionEvidence: false,
1456
- rawDomain: "skill"
1457
- }),
1458
- annotateTool({
1459
- name: "seastudio-skill_read",
1460
- description: "\u8BFB\u53D6\u6307\u5B9A skill \u76EE\u5F55\u5185\u7684\u9644\u5C5E\u6587\u672C\u6587\u4EF6\u3002path \u5FC5\u987B\u6765\u81EA seastudio-skill_get \u8FD4\u56DE\u7684 files \u6E05\u5355\u3002\u53EF\u9009 projectId \u7528\u4E8E\u9650\u5B9A\u53EA\u80FD\u8BFB\u53D6\u5F53\u524D\u4F1A\u8BDD\u9879\u76EE\u53EF\u89C1\u7684 skill\u3002\u5355\u6B21\u6700\u591A\u8BFB\u53D6 1MiB\uFF1B\u82E5\u8FD4\u56DE truncated=true\uFF0C\u53EF\u4F7F\u7528 nextOffset \u4F5C\u4E3A offset \u518D\u6B21\u8C03\u7528\u7EE7\u7EED\u8BFB\u53D6\u3002",
1461
- inputSchema: {
1462
- type: "object",
1463
- properties: {
1464
- id: {
1465
- type: "string",
1466
- description: 'Skill \u7684\u7A33\u5B9A id\uFF08\u5982 "seastudio:my-skill"\uFF09\u3002'
1467
- },
1468
- path: {
1469
- type: "string",
1470
- description: "\u8981\u8BFB\u53D6\u7684 skill \u5185\u76F8\u5BF9\u8DEF\u5F84\uFF0C\u5FC5\u987B\u4F4D\u4E8E\u8BE5 skill \u76EE\u5F55\u5185\uFF0C\u4E0D\u80FD\u662F\u7EDD\u5BF9\u8DEF\u5F84\u6216\u5305\u542B\u8DEF\u5F84\u7A7F\u8D8A\u3002"
1471
- },
1472
- projectId: {
1473
- type: "string",
1474
- description: "\u53EF\u9009\uFF1A\u5F53\u524D\u4F1A\u8BDD\u6240\u5C5E\u9879\u76EE ID\u3002\u4F20\u5165\u540E\u53EA\u5141\u8BB8\u8BFB\u53D6\u5168\u5C40 skill \u6216\u8BE5\u9879\u76EE\u53EF\u89C1\u7684 skill\u3002"
1475
- },
1476
- offset: {
1477
- type: "integer",
1478
- minimum: 0,
1479
- description: "\u53EF\u9009\uFF1A\u4ECE\u6587\u4EF6\u7684 byte offset \u5F00\u59CB\u8BFB\u53D6\uFF0C\u9ED8\u8BA4 0\u3002\u7528\u4E8E\u5206\u6BB5\u8BFB\u53D6\u8D85\u8FC7 1MiB \u7684\u6587\u672C\u6587\u4EF6\u3002"
1480
- }
1481
- },
1482
- required: ["id", "path"]
1483
- }
1484
- }, {
1485
- operationKind: "read",
1486
- requiresExecutionEvidence: false,
1487
- rawDomain: "skill"
1488
- })
1489
- ];
1490
-
1491
- // src/mcp/seastudio/tools-browser.ts
1492
- var browserSessionIdParam = {
1493
- browserSessionId: { type: "string", description: "Browser session ID" }
1494
- };
1495
- var tabIdParam = {
1496
- tabId: { type: "string", description: "Browser tab ID" }
1497
- };
1498
- var browserRuntimeTools = [
1499
- annotateTool({
1500
- name: "seastudio-browser_session_open",
1501
- description: "\u521B\u5EFA\u6216\u6253\u5F00\u4E00\u4E2A\u5BBF\u4E3B Browser Session\uFF0C\u8FD4\u56DE browserSessionId\u3002Session \u53EF\u88AB agent \u548C Browser \u63D2\u4EF6\u5171\u540C\u64CD\u4F5C\u3002",
1502
- inputSchema: {
1503
- type: "object",
1504
- properties: {
1505
- label: { type: "string", description: "\u53EF\u9009 session \u663E\u793A\u540D\u79F0\u3002" },
1506
- partitionKey: { type: "string", description: "\u53EF\u9009\u7F51\u7AD9\u6570\u636E\u5206\u533A key\uFF1B\u76F8\u540C key \u5171\u4EAB cookie/localStorage\u3002" },
1507
- homepage: { type: "string", description: "\u53EF\u9009\u9ED8\u8BA4\u9996\u9875\u3002" }
1508
- }
1509
- }
1510
- }, {
1511
- operationKind: "mutate",
1512
- requiresExecutionEvidence: false,
1513
- rawDomain: "browser"
1514
- }),
1515
- annotateTool({
1516
- name: "seastudio-browser_session_list",
1517
- description: "\u5217\u51FA\u5F53\u524D\u6240\u6709 Browser Session\u3002",
1518
- inputSchema: {
1519
- type: "object",
1520
- properties: {}
1521
- }
1522
- }, {
1523
- operationKind: "read",
1524
- requiresExecutionEvidence: false,
1525
- rawDomain: "browser"
1526
- }),
1527
- annotateTool({
1528
- name: "seastudio-browser_session_get",
1529
- description: "\u8BFB\u53D6\u6307\u5B9A Browser Session \u7684\u5F53\u524D\u72B6\u6001\u3002",
1530
- inputSchema: {
1531
- type: "object",
1532
- properties: browserSessionIdParam,
1533
- required: ["browserSessionId"]
1534
- }
1535
- }, {
1536
- operationKind: "read",
1537
- requiresExecutionEvidence: false,
1538
- rawDomain: "browser"
1539
- }),
1540
- annotateTool({
1541
- name: "seastudio-browser_session_close",
1542
- description: "\u5173\u95ED Browser Session \u5E76\u91CA\u653E\u5176 tabs \u4E0E surface \u7ED1\u5B9A\u3002",
1543
- inputSchema: {
1544
- type: "object",
1545
- properties: browserSessionIdParam,
1546
- required: ["browserSessionId"]
1547
- }
1548
- }, {
1549
- operationKind: "mutate",
1550
- requiresExecutionEvidence: false,
1551
- rawDomain: "browser"
1552
- }),
1553
- annotateTool({
1554
- name: "seastudio-browser_tab_create",
1555
- description: "\u5728 Browser Session \u4E2D\u521B\u5EFA\u4E00\u4E2A tab\u3002",
1556
- inputSchema: {
1557
- type: "object",
1558
- properties: {
1559
- ...browserSessionIdParam,
1560
- url: { type: "string", description: "\u521D\u59CB URL\uFF1B\u4E3A\u7A7A\u65F6\u4F7F\u7528 session homepage\u3002" }
1561
- },
1562
- required: ["browserSessionId"]
1563
- }
1564
- }, {
1565
- operationKind: "mutate",
1566
- requiresExecutionEvidence: false,
1567
- rawDomain: "browser"
1568
- }),
1569
- annotateTool({
1570
- name: "seastudio-browser_tab_close",
1571
- description: "\u5173\u95ED Browser Session \u4E2D\u7684 tab\u3002",
1572
- inputSchema: {
1573
- type: "object",
1574
- properties: {
1575
- ...browserSessionIdParam,
1576
- ...tabIdParam
1577
- },
1578
- required: ["browserSessionId", "tabId"]
1579
- }
1580
- }, {
1581
- operationKind: "mutate",
1582
- requiresExecutionEvidence: false,
1583
- rawDomain: "browser"
1584
- }),
1585
- annotateTool({
1586
- name: "seastudio-browser_tab_activate",
1587
- description: "\u6FC0\u6D3B Browser Session \u4E2D\u7684 tab\u3002",
1588
- inputSchema: {
1589
- type: "object",
1590
- properties: {
1591
- ...browserSessionIdParam,
1592
- ...tabIdParam
1593
- },
1594
- required: ["browserSessionId", "tabId"]
1595
- }
1596
- }, {
1597
- operationKind: "mutate",
1598
- requiresExecutionEvidence: false,
1599
- rawDomain: "browser"
1600
- }),
1601
- annotateTool({
1602
- name: "seastudio-browser_tab_navigate",
1603
- description: "\u8BA9 Browser Session \u4E2D\u7684 tab \u5BFC\u822A\u5230 URL \u6216\u641C\u7D22\u8BCD\u3002",
1604
- inputSchema: {
1605
- type: "object",
1606
- properties: {
1607
- ...browserSessionIdParam,
1608
- ...tabIdParam,
1609
- url: { type: "string", description: "\u76EE\u6807 URL \u6216\u641C\u7D22\u8BCD\u3002" }
1610
- },
1611
- required: ["browserSessionId", "tabId", "url"]
1612
- }
1613
- }, {
1614
- operationKind: "mutate",
1615
- requiresExecutionEvidence: false,
1616
- rawDomain: "browser"
1617
- }),
1618
- annotateTool({
1619
- name: "seastudio-browser_tab_go_back",
1620
- description: "\u8BA9 Browser Session \u4E2D\u7684 tab \u540E\u9000\u3002",
1621
- inputSchema: {
1622
- type: "object",
1623
- properties: {
1624
- ...browserSessionIdParam,
1625
- ...tabIdParam
1626
- },
1627
- required: ["browserSessionId", "tabId"]
1628
- }
1629
- }, {
1630
- operationKind: "mutate",
1631
- requiresExecutionEvidence: false,
1632
- rawDomain: "browser"
1633
- }),
1634
- annotateTool({
1635
- name: "seastudio-browser_tab_go_forward",
1636
- description: "\u8BA9 Browser Session \u4E2D\u7684 tab \u524D\u8FDB\u3002",
1637
- inputSchema: {
1638
- type: "object",
1639
- properties: {
1640
- ...browserSessionIdParam,
1641
- ...tabIdParam
1642
- },
1643
- required: ["browserSessionId", "tabId"]
1644
- }
1645
- }, {
1646
- operationKind: "mutate",
1647
- requiresExecutionEvidence: false,
1648
- rawDomain: "browser"
1649
- }),
1650
- annotateTool({
1651
- name: "seastudio-browser_tab_reload",
1652
- description: "\u5237\u65B0 Browser Session \u4E2D\u7684 tab\u3002",
1653
- inputSchema: {
1654
- type: "object",
1655
- properties: {
1656
- ...browserSessionIdParam,
1657
- ...tabIdParam
1658
- },
1659
- required: ["browserSessionId", "tabId"]
1660
- }
1661
- }, {
1662
- operationKind: "mutate",
1663
- requiresExecutionEvidence: false,
1664
- rawDomain: "browser"
1665
- }),
1666
- annotateTool({
1667
- name: "seastudio-browser_tab_stop",
1668
- description: "\u505C\u6B62 Browser Session \u4E2D\u7684 tab \u52A0\u8F7D\u3002",
1669
- inputSchema: {
1670
- type: "object",
1671
- properties: {
1672
- ...browserSessionIdParam,
1673
- ...tabIdParam
1674
- },
1675
- required: ["browserSessionId", "tabId"]
1676
- }
1677
- }, {
1678
- operationKind: "mutate",
1679
- requiresExecutionEvidence: false,
1680
- rawDomain: "browser"
1681
- }),
1682
- annotateTool({
1683
- name: "seastudio-browser_viewport_bind",
1684
- description: "\u628A\u4E00\u4E2A Browser Session \u7ED1\u5B9A\u5230\u5F53\u524D UI viewport\uFF0C\u7528\u4E8E\u5BBF\u4E3B\u6E32\u67D3\u771F\u5B9E webview surface\u3002",
1685
- inputSchema: {
1686
- type: "object",
1687
- properties: {
1688
- ...browserSessionIdParam,
1689
- ownerInstanceId: { type: "string", description: "\u53EF\u9009 UI owner instance id\u3002" },
1690
- rect: {
1691
- type: "object",
1692
- properties: {
1693
- x: { type: "number" },
1694
- y: { type: "number" },
1695
- width: { type: "number" },
1696
- height: { type: "number" }
1697
- },
1698
- required: ["x", "y", "width", "height"]
1699
- }
1700
- },
1701
- required: ["browserSessionId", "rect"]
1702
- }
1703
- }, {
1704
- operationKind: "mutate",
1705
- requiresExecutionEvidence: false,
1706
- rawDomain: "browser"
1707
- }),
1708
- annotateTool({
1709
- name: "seastudio-browser_certificate_respond",
1710
- description: "\u54CD\u5E94 Browser Session \u8BC1\u4E66\u9519\u8BEF\u51B3\u7B56\u3002",
1711
- inputSchema: {
1712
- type: "object",
1713
- properties: {
1714
- ...browserSessionIdParam,
1715
- requestId: { type: "string", description: "\u8BC1\u4E66\u9519\u8BEF\u8BF7\u6C42 ID\u3002" },
1716
- allow: { type: "boolean", description: "\u662F\u5426\u7EE7\u7EED\u52A0\u8F7D\u8BE5\u8BC1\u4E66\u9519\u8BEF\u9875\u9762\u3002" }
1717
- },
1718
- required: ["browserSessionId", "requestId", "allow"]
1719
- }
1720
- }, {
1721
- operationKind: "mutate",
1722
- requiresExecutionEvidence: false,
1723
- rawDomain: "browser"
1724
- })
1725
- ];
1726
-
1727
- // src/mcp/seastudio/notifications.ts
1728
- var SeastudioRequests = {
1729
- /** 请求打开文件 -> 主程序发布 FILE_OPEN_REQUESTED */
1730
- FILE_OPEN: "request:file_open",
1731
- /** 请求标记文件已修改 -> 主程序发布 FILE_MODIFIED */
1732
- FILE_MODIFIED: "request:file_modified",
1733
- /** 请求标记文件已保存 -> 主程序发布 FILE_SAVED */
1734
- FILE_SAVED: "request:file_saved",
1735
- /** 请求发送文本给 Agent -> 主程序发布 TEXT_SEND_REQUESTED */
1736
- TEXT_SEND: "request:text_send"
1737
- };
1738
- var SeastudioNotifications = {
1739
- /** 文件系统变化通知(fs.watch 触发) */
1740
- FILES_CHANGED: "files:changed",
1741
- /** 文件或目录被重命名/移动 */
1742
- FILE_RENAMED: "file:renamed",
1743
- /** 文件或目录被删除/移入回收站 */
1744
- FILE_DELETED: "file:deleted",
1745
- /** 根目录变化通知 */
1746
- ROOTS_CHANGED: "roots:changed",
1747
- /** 文件打开请求,可广播也可定向 */
1748
- FILE_OPEN_REQUESTED: "seastudio:file-open_requested",
1749
- /** 文件固定请求:将当前临时打开的文件实例转为固定 */
1750
- FILE_KEEP_REQUESTED: "seastudio:file-keep_requested",
1751
- /** 文件已修改通知(内容变化,未保存) */
1752
- FILE_MODIFIED: "file:modified",
1753
- /** 文件已保存通知 */
1754
- FILE_SAVED: "file:saved",
1755
- /** 文件被选中通知 */
1756
- FILE_SELECTED: "file:selected",
1757
- /** 文件发送请求 */
1758
- FILE_SEND_REQUESTED: "seastudio:file-send_requested",
1759
- /** 文本发送请求 */
1760
- TEXT_SEND_REQUESTED: "seastudio:text-send_requested",
1761
- /** 代码提案审核反馈 */
1762
- PROPOSAL_FEEDBACK: "seastudio:proposal-feedback",
1763
- /** 插件实例请求更新宿主 plugin tab 标题 */
1764
- PLUGIN_TAB_TITLE_CHANGED: "plugin:tab-title_changed",
1765
- /** Browser Session 状态变化 */
1766
- BROWSER_SESSION_CHANGED: "browser:session_changed",
1767
- /** Browser Session 关闭 */
1768
- BROWSER_SESSION_CLOSED: "browser:session_closed",
1769
- /** Browser Session 证书错误,需要客户端 UI 决策 */
1770
- BROWSER_CERTIFICATE_ERROR: "browser:certificate_error",
1771
- /** Browser Session 收到网页新标签请求 */
1772
- BROWSER_NEW_TAB_REQUESTED: "browser:new_tab_requested",
1773
- /**
1774
- * Agent 对话 session:新建。消息历史仍由 Agent 前端持有,宿主仅同步列表用于侧栏。
1775
- * 通常由 Agent 通过 notifications/publish 发出;其他订阅者(含 host-ui)可据此更新 UI。
1776
- */
1777
- SESSION_CREATED: "session:created",
1778
- /**
1779
- * Agent 对话 session:当前选中项变化。
1780
- * 可由 Agent 广播,或由宿主侧栏通过 publishTo(targetPluginId, targetInstanceId) 定向到单个 Agent 标签。
1781
- */
1782
- SESSION_SELECTED: "session:selected",
1783
- /** Agent 对话 session:摘要或标题更新,供侧栏展示 */
1784
- SESSION_SUMMARY: "session:summary",
1785
- /** Agent 对话 session:运行状态更新,供宿主侧栏展示 */
1786
- SESSION_STATUS: "session:status",
1787
- /** Agent 对话 session:从宿主列表移除(删除/归档等) */
1788
- SESSION_REMOVED: "session:removed",
1789
- /**
1790
- * Agent 在初始化或线程列表与当前选中稳定后,向宿主全量同步:
1791
- * 每个 agent 实例(通常每项目一个)下的会话列表与当前选中的 sessionId。
1792
- * 宿主应用此通知重建侧栏列表,避免仅靠逐条 SESSION_CREATED 时重启后空白。
1793
- */
1794
- SESSION_STATE_SNAPSHOT: "session:state_snapshot",
1795
- /**
1796
- * 宿主请求 Agent 新建一条对话会话(例如侧栏项目行的「+」)。
1797
- * 通过 notifications/publish + publishTo 定向到对应 Agent 实例。
1798
- */
1799
- SESSION_NEW_REQUESTED: "session:new_requested",
1800
- /**
1801
- * 宿主请求 Agent 删除/关闭某条对话会话(例如侧栏会话行「×」)。
1802
- * 通过 notifications/publish + publishTo 定向到对应 Agent 实例。
1803
- */
1804
- SESSION_DELETE_REQUESTED: "session:delete_requested"
1805
- };
1806
-
1807
- // src/mcp/seastudio/index.ts
1808
- var allTools = [
1809
- ...fileTools,
1810
- ...shellTools,
1811
- ...seaCloudTools,
1812
- ...pluginManagementTools,
1813
- ...agentManagementTools,
1814
- ...pluginTabTools,
1815
- ...agentTabTools,
1816
- ...projectTools,
1817
- ...skillTools,
1818
- ...browserRuntimeTools
1819
- ];
1820
- var tools = allTools;
1821
-
1822
- export { SeastudioNotifications, SeastudioRequests, agentManagementTools, agentTabTools, allTools, annotateTool, batchFlattenCopyEvidenceOutputSchema, browserRuntimeTools, callTool, callToolText, dualPathEvidenceOutputSchema, fileDownloadEvidenceOutputSchema, fileTools, fileUrlEvidenceOutputSchema, pluginManagementTools, pluginTabTools, projectTools, request, rootedPathEvidenceOutputSchema, rootedWriteEvidenceOutputSchema, runOneShotShellCommand, seaCloudTools, seastudio, shellSessionCloseEvidenceOutputSchema, shellSessionOpenEvidenceOutputSchema, shellSessionRunEvidenceOutputSchema, shellSessionSignalEvidenceOutputSchema, shellSessionSnapshotEvidenceOutputSchema, shellTools, skillTools, tools };