@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,654 @@
1
+ 'use strict';
2
+
3
+ var chunkTFOJLA2F_cjs = require('./chunk-TFOJLA2F.cjs');
4
+
5
+ // src/mcp/plugin-editor/tools.ts
6
+ function annotateTool(tool, annotations, outputSchema) {
7
+ return {
8
+ ...tool,
9
+ annotations,
10
+ ...outputSchema ? { outputSchema } : {}
11
+ };
12
+ }
13
+ var editorPathEvidenceOutputSchema = {
14
+ type: "object",
15
+ properties: {
16
+ path: { type: "string" }
17
+ },
18
+ required: ["path"]
19
+ };
20
+ var fileOperationTools = [
21
+ annotateTool({
22
+ name: "editor-open_file",
23
+ description: "\u5728\u7F16\u8F91\u5668\u4E2D\u6253\u5F00\u6307\u5B9A\u6587\u4EF6\uFF0C\u53EF\u9009\u8DF3\u8F6C\u5230\u884C\u5217\u4F4D\u7F6E\u3002\u9002\u7528\u4E8E\u628A\u76EE\u6807\u6587\u4EF6\u5E26\u5230\u524D\u53F0\u4F9B\u7528\u6237\u67E5\u770B\u6216\u7EE7\u7EED\u7F16\u8F91\u3002",
24
+ inputSchema: {
25
+ type: "object",
26
+ properties: {
27
+ path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84" },
28
+ line: { type: "number", description: "\u8DF3\u8F6C\u5230\u7684\u884C\u53F7\uFF08\u53EF\u9009\uFF09" },
29
+ column: { type: "number", description: "\u8DF3\u8F6C\u5230\u7684\u5217\u53F7\uFF08\u53EF\u9009\uFF09" }
30
+ },
31
+ required: ["path"]
32
+ }
33
+ }, {
34
+ operationKind: "system",
35
+ requiresExecutionEvidence: true,
36
+ rawDomain: "editor"
37
+ }, editorPathEvidenceOutputSchema),
38
+ annotateTool({
39
+ name: "editor-save_file",
40
+ description: "\u4FDD\u5B58\u6307\u5B9A\u6587\u4EF6",
41
+ inputSchema: {
42
+ type: "object",
43
+ properties: {
44
+ path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84\uFF0C\u4E0D\u4F20\u5219\u4FDD\u5B58\u5F53\u524D\u6587\u4EF6" }
45
+ }
46
+ }
47
+ }, {
48
+ operationKind: "mutate",
49
+ requiresExecutionEvidence: true,
50
+ rawDomain: "editor"
51
+ }, editorPathEvidenceOutputSchema),
52
+ annotateTool({
53
+ name: "editor-get_dirty_files",
54
+ description: "\u83B7\u53D6\u7F16\u8F91\u5668\u4E2D\u6240\u6709\u672A\u4FDD\u5B58\u6587\u4EF6\u5217\u8868\u3002\u9002\u7528\u4E8E\u5728\u8BFB\u5199\u524D\u5224\u65AD\u662F\u5426\u5B58\u5728\u672A\u843D\u76D8\u5185\u5BB9\u3002",
55
+ inputSchema: {
56
+ type: "object",
57
+ properties: {}
58
+ }
59
+ }, {
60
+ operationKind: "read",
61
+ requiresExecutionEvidence: false,
62
+ rawDomain: "editor"
63
+ }, {
64
+ type: "object",
65
+ properties: {
66
+ files: {
67
+ type: "array",
68
+ items: {
69
+ type: "object",
70
+ properties: {
71
+ path: { type: "string" },
72
+ isDirty: { type: "boolean" }
73
+ }
74
+ }
75
+ }
76
+ }
77
+ }),
78
+ annotateTool({
79
+ name: "editor-get_editing_file",
80
+ description: '\u83B7\u53D6\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u6587\u4EF6\u7684\u8DEF\u5F84\u3001\u5185\u5BB9\u548C\u810F\u72B6\u6001\u3002\u9002\u7528\u4E8E\u7EED\u63A5"\u5F53\u524D\u6587\u4EF6/\u8FD9\u4E2A\u6587\u4EF6"\u7684\u4E0A\u4E0B\u6587\u3002',
81
+ inputSchema: {
82
+ type: "object",
83
+ properties: {}
84
+ }
85
+ }, {
86
+ operationKind: "read",
87
+ requiresExecutionEvidence: false,
88
+ rawDomain: "editor"
89
+ }, {
90
+ type: "object",
91
+ properties: {
92
+ path: { type: "string" },
93
+ content: { type: "string" },
94
+ isDirty: { type: "boolean" }
95
+ }
96
+ }),
97
+ annotateTool({
98
+ name: "editor-file_saved",
99
+ description: "\u67E5\u8BE2\u6307\u5B9A\u6587\u4EF6\u662F\u5426\u5DF2\u4FDD\u5B58",
100
+ inputSchema: {
101
+ type: "object",
102
+ properties: {
103
+ path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84" }
104
+ },
105
+ required: ["path"]
106
+ }
107
+ }, {
108
+ operationKind: "read",
109
+ requiresExecutionEvidence: false,
110
+ rawDomain: "editor"
111
+ }),
112
+ annotateTool({
113
+ name: "editor-file_editing",
114
+ description: "\u67E5\u8BE2\u6307\u5B9A\u6587\u4EF6\u662F\u5426\u6B63\u5728\u7F16\u8F91\u4E2D",
115
+ inputSchema: {
116
+ type: "object",
117
+ properties: {
118
+ path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84" }
119
+ },
120
+ required: ["path"]
121
+ }
122
+ }, {
123
+ operationKind: "read",
124
+ requiresExecutionEvidence: false,
125
+ rawDomain: "editor"
126
+ })
127
+ ];
128
+ var sessionTools = [
129
+ annotateTool({
130
+ name: "editor-list_open_files",
131
+ description: "\u5217\u51FA\u7F16\u8F91\u5668\u5F53\u524D\u6240\u6709\u5DF2\u6253\u5F00\u7684\u6587\u4EF6\u6807\u7B7E\u9875\uFF0C\u5305\u542B\u8DEF\u5F84\u3001\u8BED\u8A00\u3001\u810F\u72B6\u6001\u3002",
132
+ inputSchema: { type: "object", properties: {} }
133
+ }, {
134
+ operationKind: "read",
135
+ requiresExecutionEvidence: false,
136
+ rawDomain: "editor"
137
+ }),
138
+ annotateTool({
139
+ name: "editor-get_active_file",
140
+ description: "\u83B7\u53D6\u7F16\u8F91\u5668\u5F53\u524D\u6FC0\u6D3B\u6587\u4EF6\u7684\u5B8C\u6574\u4FE1\u606F\uFF1A\u8DEF\u5F84\u3001\u5185\u5BB9\u3001\u8BED\u8A00\u3001\u810F\u72B6\u6001\u3002",
141
+ inputSchema: { type: "object", properties: {} }
142
+ }, {
143
+ operationKind: "read",
144
+ requiresExecutionEvidence: false,
145
+ rawDomain: "editor"
146
+ }),
147
+ annotateTool({
148
+ name: "editor-focus_file",
149
+ description: "\u5C06\u7F16\u8F91\u5668\u7126\u70B9\u5207\u6362\u5230\u6307\u5B9A\u5DF2\u6253\u5F00\u7684\u6587\u4EF6\u6807\u7B7E\u9875\u3002",
150
+ inputSchema: {
151
+ type: "object",
152
+ properties: {
153
+ file_key: { type: "string", description: "\u6587\u4EF6\u6807\u7B7E\u9875\u7684 key (rootId:path)" }
154
+ },
155
+ required: ["file_key"]
156
+ }
157
+ }, {
158
+ operationKind: "system",
159
+ requiresExecutionEvidence: true,
160
+ rawDomain: "editor"
161
+ }),
162
+ annotateTool({
163
+ name: "editor-close_file",
164
+ description: "\u5173\u95ED\u7F16\u8F91\u5668\u4E2D\u6307\u5B9A\u7684\u6587\u4EF6\u6807\u7B7E\u9875\u3002",
165
+ inputSchema: {
166
+ type: "object",
167
+ properties: {
168
+ file_key: { type: "string", description: "\u6587\u4EF6\u6807\u7B7E\u9875\u7684 key (rootId:path)" }
169
+ },
170
+ required: ["file_key"]
171
+ }
172
+ }, {
173
+ operationKind: "system",
174
+ requiresExecutionEvidence: true,
175
+ rawDomain: "editor"
176
+ }),
177
+ annotateTool({
178
+ name: "editor-save_all_files",
179
+ description: "\u4FDD\u5B58\u7F16\u8F91\u5668\u4E2D\u6240\u6709\u672A\u4FDD\u5B58\u7684\u6587\u4EF6\u3002",
180
+ inputSchema: { type: "object", properties: {} }
181
+ }, {
182
+ operationKind: "mutate",
183
+ requiresExecutionEvidence: true,
184
+ rawDomain: "editor"
185
+ })
186
+ ];
187
+ var fileMutationTools = [
188
+ annotateTool({
189
+ name: "editor-create_file",
190
+ description: "\u521B\u5EFA\u65B0\u6587\u4EF6\u5E76\u5728\u7F16\u8F91\u5668\u4E2D\u6253\u5F00\u3002\u4EC5\u7528\u4E8E\u521B\u5EFA\u4E0D\u5B58\u5728\u7684\u65B0\u6587\u4EF6\u3002\u4FEE\u6539\u5DF2\u6709\u6587\u4EF6\u5FC5\u987B\u4F7F\u7528 editor-proposal_create\u3002",
191
+ inputSchema: {
192
+ type: "object",
193
+ properties: {
194
+ path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84" },
195
+ content: { type: "string", description: "\u6587\u4EF6\u5185\u5BB9\uFF08\u53EF\u9009\uFF0C\u9ED8\u8BA4\u7A7A\uFF09" },
196
+ root_id: { type: "string", enum: ["workspace"], description: "\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" }
197
+ },
198
+ required: ["path"]
199
+ }
200
+ }, {
201
+ operationKind: "mutate",
202
+ requiresExecutionEvidence: true,
203
+ rawDomain: "editor"
204
+ }),
205
+ annotateTool({
206
+ name: "editor-create_dir",
207
+ description: "\u521B\u5EFA\u76EE\u5F55\u3002",
208
+ inputSchema: {
209
+ type: "object",
210
+ properties: {
211
+ path: { type: "string", description: "\u76EE\u5F55\u8DEF\u5F84" }
212
+ },
213
+ required: ["path"]
214
+ }
215
+ }, {
216
+ operationKind: "mutate",
217
+ requiresExecutionEvidence: true,
218
+ rawDomain: "editor"
219
+ }),
220
+ annotateTool({
221
+ name: "editor-rename_path",
222
+ description: "\u91CD\u547D\u540D\u6587\u4EF6\u6216\u76EE\u5F55\u3002\u5982\u679C\u6587\u4EF6\u5728\u7F16\u8F91\u5668\u4E2D\u5DF2\u6253\u5F00\uFF0C\u6807\u7B7E\u9875\u4F1A\u540C\u6B65\u66F4\u65B0\u3002",
223
+ inputSchema: {
224
+ type: "object",
225
+ properties: {
226
+ old_path: { type: "string", description: "\u539F\u8DEF\u5F84" },
227
+ new_path: { type: "string", description: "\u65B0\u8DEF\u5F84" }
228
+ },
229
+ required: ["old_path", "new_path"]
230
+ }
231
+ }, {
232
+ operationKind: "mutate",
233
+ requiresExecutionEvidence: true,
234
+ rawDomain: "editor"
235
+ }),
236
+ annotateTool({
237
+ name: "editor-delete_path",
238
+ description: "\u5220\u9664\u6587\u4EF6\u6216\u76EE\u5F55\u3002\u5982\u679C\u6587\u4EF6\u5728\u7F16\u8F91\u5668\u4E2D\u5DF2\u6253\u5F00\uFF0C\u6807\u7B7E\u9875\u4F1A\u81EA\u52A8\u5173\u95ED\u3002",
239
+ inputSchema: {
240
+ type: "object",
241
+ properties: {
242
+ path: { type: "string", description: "\u8981\u5220\u9664\u7684\u8DEF\u5F84" }
243
+ },
244
+ required: ["path"]
245
+ }
246
+ }, {
247
+ operationKind: "mutate",
248
+ requiresExecutionEvidence: true,
249
+ rawDomain: "editor"
250
+ }),
251
+ annotateTool({
252
+ name: "editor-write_file",
253
+ description: "\u521B\u5EFA\u65B0\u6587\u4EF6\u5E76\u5199\u5165\u5185\u5BB9\u540E\u5728\u7F16\u8F91\u5668\u4E2D\u6253\u5F00\u3002\u4EC5\u7528\u4E8E\u4E0D\u5B58\u5728\u7684\u65B0\u6587\u4EF6\u3002\u4FEE\u6539\u5DF2\u6709\u6587\u4EF6\u7981\u6B62\u4F7F\u7528\u6B64\u5DE5\u5177\uFF0C\u5FC5\u987B\u4F7F\u7528 editor-proposal_create \u521B\u5EFA\u63D0\u6848\u8BA9\u7528\u6237\u5BA1\u9605\u3002",
254
+ inputSchema: {
255
+ type: "object",
256
+ properties: {
257
+ path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84" },
258
+ content: { type: "string", description: "\u6587\u4EF6\u5185\u5BB9" },
259
+ root_id: { type: "string", enum: ["workspace"], description: "\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" }
260
+ },
261
+ required: ["path", "content"]
262
+ }
263
+ }, {
264
+ operationKind: "mutate",
265
+ requiresExecutionEvidence: true,
266
+ rawDomain: "editor"
267
+ }),
268
+ annotateTool({
269
+ name: "editor-write_batch",
270
+ description: "\u6279\u91CF\u521B\u5EFA\u591A\u4E2A\u65B0\u6587\u4EF6\u3002\u4EC5\u7528\u4E8E\u4E0D\u5B58\u5728\u7684\u65B0\u6587\u4EF6\u3002\u4FEE\u6539\u5DF2\u6709\u6587\u4EF6\u7981\u6B62\u4F7F\u7528\u6B64\u5DE5\u5177\uFF0C\u5FC5\u987B\u4F7F\u7528 editor-proposal_create\u3002",
271
+ inputSchema: {
272
+ type: "object",
273
+ properties: {
274
+ changes: {
275
+ type: "array",
276
+ items: {
277
+ type: "object",
278
+ properties: {
279
+ path: { type: "string" },
280
+ content: { type: "string" }
281
+ },
282
+ required: ["path", "content"]
283
+ },
284
+ description: "\u8981\u5199\u5165\u7684\u6587\u4EF6\u5217\u8868"
285
+ }
286
+ },
287
+ required: ["changes"]
288
+ }
289
+ }, {
290
+ operationKind: "mutate",
291
+ requiresExecutionEvidence: true,
292
+ rawDomain: "editor"
293
+ })
294
+ ];
295
+ var previewTools = [
296
+ annotateTool({
297
+ name: "editor-get_view_mode",
298
+ description: "\u83B7\u53D6\u7F16\u8F91\u5668\u5F53\u524D\u6587\u4EF6\u7684\u89C6\u56FE\u6A21\u5F0F\uFF08edit \u6216 preview\uFF09\u3002",
299
+ inputSchema: {
300
+ type: "object",
301
+ properties: {
302
+ file_key: { type: "string", description: "\u6587\u4EF6\u6807\u7B7E\u9875 key\uFF08\u53EF\u9009\uFF0C\u9ED8\u8BA4\u5F53\u524D\u6587\u4EF6\uFF09" }
303
+ }
304
+ }
305
+ }, {
306
+ operationKind: "read",
307
+ requiresExecutionEvidence: false,
308
+ rawDomain: "editor"
309
+ }),
310
+ annotateTool({
311
+ name: "editor-set_view_mode",
312
+ description: "\u5207\u6362\u7F16\u8F91\u5668\u7684\u89C6\u56FE\u6A21\u5F0F\u3002\u5BF9 Markdown \u6587\u4EF6\u53EF\u5728\u7F16\u8F91\u548C\u9884\u89C8\u4E4B\u95F4\u5207\u6362\u3002",
313
+ inputSchema: {
314
+ type: "object",
315
+ properties: {
316
+ mode: { type: "string", enum: ["edit", "preview"], description: "\u76EE\u6807\u89C6\u56FE\u6A21\u5F0F" },
317
+ file_key: { type: "string", description: "\u6587\u4EF6\u6807\u7B7E\u9875 key\uFF08\u53EF\u9009\uFF0C\u9ED8\u8BA4\u5F53\u524D\u6587\u4EF6\uFF09" }
318
+ },
319
+ required: ["mode"]
320
+ }
321
+ }, {
322
+ operationKind: "system",
323
+ requiresExecutionEvidence: true,
324
+ rawDomain: "editor"
325
+ }),
326
+ annotateTool({
327
+ name: "editor-render_markdown_preview",
328
+ description: "\u83B7\u53D6 Markdown \u6587\u4EF6\u7684\u9884\u89C8\u5185\u5BB9\u3002\u8FD4\u56DE\u539F\u59CB Markdown \u5185\u5BB9\u548C\u5143\u6570\u636E\u3002",
329
+ inputSchema: {
330
+ type: "object",
331
+ properties: {
332
+ path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84\uFF08\u53EF\u9009\uFF0C\u9ED8\u8BA4\u5F53\u524D\u6587\u4EF6\uFF09" }
333
+ }
334
+ }
335
+ }, {
336
+ operationKind: "read",
337
+ requiresExecutionEvidence: false,
338
+ rawDomain: "editor"
339
+ })
340
+ ];
341
+ var referenceTools = [
342
+ annotateTool({
343
+ name: "editor-resolve_path_reference",
344
+ description: "\u89E3\u6790\u6587\u4EF6\u8DEF\u5F84\u5F15\u7528\u3002\u652F\u6301\u76F8\u5BF9\u8DEF\u5F84\u3001\u7EDD\u5BF9\u8DEF\u5F84\u3001./ \u524D\u7F00\u7B49\u591A\u79CD\u98CE\u683C\uFF0C\u7EDF\u4E00\u89E3\u6790\u5230\u5B9E\u9645\u8DEF\u5F84\u3002",
345
+ inputSchema: {
346
+ type: "object",
347
+ properties: {
348
+ path: { type: "string", description: "\u5F85\u89E3\u6790\u7684\u8DEF\u5F84\u5F15\u7528" }
349
+ },
350
+ required: ["path"]
351
+ }
352
+ }, {
353
+ operationKind: "read",
354
+ requiresExecutionEvidence: false,
355
+ rawDomain: "editor"
356
+ }),
357
+ annotateTool({
358
+ name: "editor-open_reference",
359
+ description: "\u89E3\u6790\u8DEF\u5F84\u5F15\u7528\u5E76\u5728\u7F16\u8F91\u5668\u4E2D\u6253\u5F00\u5BF9\u5E94\u6587\u4EF6\u3002\u9002\u7528\u4E8E\u4EE3\u7801\u4E2D\u7684 import/require \u8DF3\u8F6C\u3002",
360
+ inputSchema: {
361
+ type: "object",
362
+ properties: {
363
+ path: { type: "string", description: "\u8DEF\u5F84\u5F15\u7528" }
364
+ },
365
+ required: ["path"]
366
+ }
367
+ }, {
368
+ operationKind: "system",
369
+ requiresExecutionEvidence: true,
370
+ rawDomain: "editor"
371
+ }),
372
+ annotateTool({
373
+ name: "editor-search_paths",
374
+ description: "\u5728\u5DE5\u4F5C\u533A\u4E2D\u6309\u6587\u4EF6\u540D\u6A21\u7CCA\u641C\u7D22\u8DEF\u5F84\u3002",
375
+ inputSchema: {
376
+ type: "object",
377
+ properties: {
378
+ query: { type: "string", description: "\u641C\u7D22\u5173\u952E\u8BCD" }
379
+ },
380
+ required: ["query"]
381
+ }
382
+ }, {
383
+ operationKind: "read",
384
+ requiresExecutionEvidence: false,
385
+ rawDomain: "editor"
386
+ })
387
+ ];
388
+ var proposalTools = [
389
+ annotateTool({
390
+ name: "editor-proposal_create",
391
+ description: "\u3010\u4FEE\u6539\u5DF2\u6709\u6587\u4EF6\u7684\u552F\u4E00\u65B9\u5F0F\u3011\u521B\u5EFA\u53D8\u66F4\u63D0\u6848\uFF0C\u5728\u7F16\u8F91\u5668\u4E2D\u4EE5\u7EA2\u8272(\u5220\u9664)\u7EFF\u8272(\u65B0\u589E)\u5185\u8054 diff \u5C55\u793A\uFF0C\u7528\u6237\u53EF\u9010\u5757\u63A5\u53D7\u6216\u62D2\u7EDD\u3002\u6D41\u7A0B\uFF1A1)\u5148 read_file \u83B7\u53D6\u539F\u5185\u5BB9 2)\u6784\u9020 hunks\uFF08\u6BCF\u4E2A hunk \u5BF9\u5E94\u4E00\u5904\u903B\u8F91\u53D8\u66F4\uFF093)\u8C03\u7528\u6B64\u5DE5\u5177 4)\u544A\u77E5\u7528\u6237\u63D0\u6848\u5DF2\u5C31\u7EEA\u5E76\u7B49\u5F85\u7528\u6237\u64CD\u4F5C\u3002\u9002\u7528\u4E8E\u6240\u6709\u6587\u4EF6\u7C7B\u578B\uFF1A\u4EE3\u7801\u3001markdown\u3001\u6587\u672C\u3001\u914D\u7F6E\u7B49\u3002\u521B\u5EFA\u540E\u4E0D\u8981\u81EA\u52A8\u8C03\u7528 apply\u3002",
392
+ inputSchema: {
393
+ type: "object",
394
+ properties: {
395
+ title: { type: "string", description: "\u63D0\u6848\u6807\u9898" },
396
+ files: {
397
+ type: "array",
398
+ items: {
399
+ type: "object",
400
+ properties: {
401
+ path: { type: "string" },
402
+ rootId: { type: "string", enum: ["workspace"] },
403
+ originalContent: { type: "string" },
404
+ proposedContent: { type: "string" },
405
+ hunks: {
406
+ type: "array",
407
+ items: {
408
+ type: "object",
409
+ properties: {
410
+ id: { type: "string" },
411
+ startLine: { type: "number" },
412
+ endLine: { type: "number" },
413
+ originalContent: { type: "string" },
414
+ proposedContent: { type: "string" }
415
+ },
416
+ required: ["id", "startLine", "endLine", "originalContent", "proposedContent"]
417
+ }
418
+ }
419
+ },
420
+ required: ["path", "originalContent", "proposedContent", "hunks"]
421
+ },
422
+ description: "\u6D89\u53CA\u7684\u6587\u4EF6\u53D8\u66F4\u5217\u8868"
423
+ }
424
+ },
425
+ required: ["title", "files"]
426
+ }
427
+ }, {
428
+ operationKind: "mutate",
429
+ requiresExecutionEvidence: true,
430
+ rawDomain: "editor"
431
+ }),
432
+ annotateTool({
433
+ name: "editor-proposal_list",
434
+ description: "\u5217\u51FA\u6240\u6709\u4EE3\u7801\u53D8\u66F4\u63D0\u6848\u3002",
435
+ inputSchema: { type: "object", properties: {} }
436
+ }, {
437
+ operationKind: "read",
438
+ requiresExecutionEvidence: false,
439
+ rawDomain: "editor"
440
+ }),
441
+ annotateTool({
442
+ name: "editor-proposal_get_diff",
443
+ description: "\u83B7\u53D6\u6307\u5B9A\u63D0\u6848\u7684 diff \u8BE6\u60C5\uFF0C\u5305\u542B\u6240\u6709\u6587\u4EF6\u7684 hunk \u5217\u8868\u3002",
444
+ inputSchema: {
445
+ type: "object",
446
+ properties: {
447
+ proposal_id: { type: "string", description: "\u63D0\u6848 ID" }
448
+ },
449
+ required: ["proposal_id"]
450
+ }
451
+ }, {
452
+ operationKind: "read",
453
+ requiresExecutionEvidence: false,
454
+ rawDomain: "editor"
455
+ }),
456
+ annotateTool({
457
+ name: "editor-proposal_apply_all",
458
+ description: "\u91C7\u7EB3\u63D0\u6848\u4E2D\u6240\u6709\u53D8\u66F4\u5E76\u5199\u5165\u6587\u4EF6\u3002\u4E0D\u8981\u5728 proposal_create \u4E4B\u540E\u81EA\u52A8\u8C03\u7528\u2014\u2014\u7528\u6237\u901A\u8FC7\u7F16\u8F91\u5668 UI \u51B3\u5B9A\u3002\u4EC5\u5728\u7528\u6237\u660E\u786E\u8981\u6C42\u65F6\u8C03\u7528\u3002",
459
+ inputSchema: {
460
+ type: "object",
461
+ properties: {
462
+ proposal_id: { type: "string", description: "\u63D0\u6848 ID" }
463
+ },
464
+ required: ["proposal_id"]
465
+ }
466
+ }, {
467
+ operationKind: "mutate",
468
+ requiresExecutionEvidence: true,
469
+ rawDomain: "editor"
470
+ }),
471
+ annotateTool({
472
+ name: "editor-proposal_apply_hunks",
473
+ description: "\u9009\u62E9\u6027\u91C7\u7EB3\u63D0\u6848\u4E2D\u7684\u90E8\u5206 hunk\u3002\u4E0D\u8981\u81EA\u52A8\u8C03\u7528\u2014\u2014\u7528\u6237\u901A\u8FC7\u7F16\u8F91\u5668 UI \u51B3\u5B9A\u3002\u4EC5\u5728\u7528\u6237\u660E\u786E\u8981\u6C42\u65F6\u8C03\u7528\u3002",
474
+ inputSchema: {
475
+ type: "object",
476
+ properties: {
477
+ proposal_id: { type: "string", description: "\u63D0\u6848 ID" },
478
+ hunk_ids: {
479
+ type: "array",
480
+ items: { type: "string" },
481
+ description: "\u8981\u91C7\u7EB3\u7684 hunk ID \u5217\u8868"
482
+ }
483
+ },
484
+ required: ["proposal_id", "hunk_ids"]
485
+ }
486
+ }, {
487
+ operationKind: "mutate",
488
+ requiresExecutionEvidence: true,
489
+ rawDomain: "editor"
490
+ }),
491
+ annotateTool({
492
+ name: "editor-proposal_reject",
493
+ description: "\u62D2\u7EDD\u63D0\u6848\u7684\u6240\u6709\u53D8\u66F4\u3002\u4E0D\u8981\u81EA\u52A8\u8C03\u7528\u2014\u2014\u7528\u6237\u901A\u8FC7\u7F16\u8F91\u5668 UI \u51B3\u5B9A\u3002\u4EC5\u5728\u7528\u6237\u660E\u786E\u8981\u6C42\u65F6\u8C03\u7528\u3002",
494
+ inputSchema: {
495
+ type: "object",
496
+ properties: {
497
+ proposal_id: { type: "string", description: "\u63D0\u6848 ID" }
498
+ },
499
+ required: ["proposal_id"]
500
+ }
501
+ }, {
502
+ operationKind: "mutate",
503
+ requiresExecutionEvidence: true,
504
+ rawDomain: "editor"
505
+ })
506
+ ];
507
+ var extensionTools = [
508
+ annotateTool({
509
+ name: "editor-ext_list",
510
+ description: "\u5217\u51FA\u7F16\u8F91\u5668\u4E2D\u6240\u6709\u5DF2\u6CE8\u518C\u7684\u6269\u5C55\uFF0C\u6309\u7C7B\u578B\u5206\u7EC4\u3002",
511
+ inputSchema: {
512
+ type: "object",
513
+ properties: {
514
+ type: { type: "string", enum: ["diagnostics", "proposal", "preview", "command", "completion"], description: "\u53EF\u9009\uFF0C\u6309\u7C7B\u578B\u8FC7\u6EE4" }
515
+ }
516
+ }
517
+ }, {
518
+ operationKind: "read",
519
+ requiresExecutionEvidence: false,
520
+ rawDomain: "editor"
521
+ }),
522
+ annotateTool({
523
+ name: "editor-ext_run_command",
524
+ description: "\u6267\u884C\u7F16\u8F91\u5668\u4E2D\u5DF2\u6CE8\u518C\u7684\u547D\u4EE4\u6269\u5C55\u3002",
525
+ inputSchema: {
526
+ type: "object",
527
+ properties: {
528
+ extension_id: { type: "string", description: "\u547D\u4EE4\u6269\u5C55\u7684 ID" },
529
+ file_path: { type: "string", description: "\u5F53\u524D\u6587\u4EF6\u8DEF\u5F84\uFF08\u53EF\u9009\uFF09" },
530
+ content: { type: "string", description: "\u5F53\u524D\u6587\u4EF6\u5185\u5BB9\uFF08\u53EF\u9009\uFF09" },
531
+ selection: {
532
+ type: "object",
533
+ properties: {
534
+ startLine: { type: "number" },
535
+ startColumn: { type: "number" },
536
+ endLine: { type: "number" },
537
+ endColumn: { type: "number" },
538
+ text: { type: "string" }
539
+ },
540
+ description: "\u5F53\u524D\u9009\u533A\uFF08\u53EF\u9009\uFF09"
541
+ }
542
+ },
543
+ required: ["extension_id"]
544
+ }
545
+ }, {
546
+ operationKind: "mutate",
547
+ requiresExecutionEvidence: true,
548
+ rawDomain: "editor"
549
+ }),
550
+ annotateTool({
551
+ name: "editor-ext_run_diagnostics",
552
+ description: "\u4F7F\u7528\u6307\u5B9A\u7684\u8BCA\u65AD\u6269\u5C55\u5BF9\u6587\u4EF6\u6267\u884C\u8BCA\u65AD\u68C0\u67E5\u3002",
553
+ inputSchema: {
554
+ type: "object",
555
+ properties: {
556
+ extension_id: { type: "string", description: "\u8BCA\u65AD\u6269\u5C55 ID\uFF08\u53EF\u9009\uFF0C\u4E0D\u4F20\u5219\u8FD0\u884C\u6240\u6709\u5339\u914D\u7684\u8BCA\u65AD\u6269\u5C55\uFF09" },
557
+ file_path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84" },
558
+ language: { type: "string", description: "\u8BED\u8A00\u6807\u8BC6\uFF08\u53EF\u9009\uFF0C\u9ED8\u8BA4\u81EA\u52A8\u68C0\u6D4B\uFF09" },
559
+ content: { type: "string", description: "\u6587\u4EF6\u5185\u5BB9" }
560
+ },
561
+ required: ["file_path", "content"]
562
+ }
563
+ }, {
564
+ operationKind: "read",
565
+ requiresExecutionEvidence: false,
566
+ rawDomain: "editor"
567
+ }),
568
+ annotateTool({
569
+ name: "editor-ext_get_completions",
570
+ description: "\u4F7F\u7528\u8865\u5168\u6269\u5C55\u83B7\u53D6\u4EE3\u7801\u8865\u5168\u5EFA\u8BAE\u3002",
571
+ inputSchema: {
572
+ type: "object",
573
+ properties: {
574
+ file_path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84" },
575
+ language: { type: "string", description: "\u8BED\u8A00\u6807\u8BC6" },
576
+ content: { type: "string", description: "\u6587\u4EF6\u5185\u5BB9" },
577
+ line: { type: "number", description: "\u5149\u6807\u884C\u53F7" },
578
+ column: { type: "number", description: "\u5149\u6807\u5217\u53F7" },
579
+ prefix: { type: "string", description: "\u5F53\u524D\u8F93\u5165\u524D\u7F00" }
580
+ },
581
+ required: ["file_path", "content", "line", "column", "prefix"]
582
+ }
583
+ }, {
584
+ operationKind: "read",
585
+ requiresExecutionEvidence: false,
586
+ rawDomain: "editor"
587
+ })
588
+ ];
589
+ var tools = fileOperationTools;
590
+ var allTools = [
591
+ ...fileOperationTools,
592
+ ...sessionTools,
593
+ ...fileMutationTools,
594
+ ...previewTools,
595
+ ...referenceTools,
596
+ ...proposalTools,
597
+ ...extensionTools
598
+ ];
599
+ async function callTool(name, args = {}) {
600
+ return chunkTFOJLA2F_cjs.getDefaultClient().callTool(name, args);
601
+ }
602
+ var editor = {
603
+ // Original
604
+ openFile: (path, line, column) => callTool("editor-open_file", { path, line, column }),
605
+ saveFile: (path) => callTool("editor-save_file", { path }),
606
+ getDirtyFiles: () => callTool("editor-get_dirty_files", {}),
607
+ getEditingFile: () => callTool("editor-get_editing_file", {}),
608
+ fileSaved: (path) => callTool("editor-file_saved", { path }),
609
+ fileEditing: (path) => callTool("editor-file_editing", { path }),
610
+ // Session / State
611
+ listOpenFiles: () => callTool("editor-list_open_files", {}),
612
+ getActiveFile: () => callTool("editor-get_active_file", {}),
613
+ focusFile: (fileKey) => callTool("editor-focus_file", { file_key: fileKey }),
614
+ closeFile: (fileKey) => callTool("editor-close_file", { file_key: fileKey }),
615
+ saveAllFiles: () => callTool("editor-save_all_files", {}),
616
+ // File Mutation
617
+ createFile: (path, content, rootId) => callTool("editor-create_file", { path, content, root_id: rootId }),
618
+ createDir: (path) => callTool("editor-create_dir", { path }),
619
+ renamePath: (oldPath, newPath) => callTool("editor-rename_path", { old_path: oldPath, new_path: newPath }),
620
+ deletePath: (path) => callTool("editor-delete_path", { path }),
621
+ writeFile: (path, content, rootId) => callTool("editor-write_file", { path, content, root_id: rootId }),
622
+ writeBatch: (changes) => callTool("editor-write_batch", { changes }),
623
+ // Preview
624
+ getViewMode: (fileKey) => callTool("editor-get_view_mode", { file_key: fileKey }),
625
+ setViewMode: (mode, fileKey) => callTool("editor-set_view_mode", { mode, file_key: fileKey }),
626
+ renderMarkdownPreview: (path) => callTool("editor-render_markdown_preview", { path }),
627
+ // References
628
+ resolvePathReference: (path) => callTool("editor-resolve_path_reference", { path }),
629
+ openReference: (path) => callTool("editor-open_reference", { path }),
630
+ searchPaths: (query) => callTool("editor-search_paths", { query }),
631
+ // Proposals
632
+ createProposal: (title, files) => callTool("editor-proposal_create", { title, files }),
633
+ listProposals: () => callTool("editor-proposal_list", {}),
634
+ getProposalDiff: (proposalId) => callTool("editor-proposal_get_diff", { proposal_id: proposalId }),
635
+ applyProposalAll: (proposalId) => callTool("editor-proposal_apply_all", { proposal_id: proposalId }),
636
+ applyProposalHunks: (proposalId, hunkIds) => callTool("editor-proposal_apply_hunks", { proposal_id: proposalId, hunk_ids: hunkIds }),
637
+ rejectProposal: (proposalId) => callTool("editor-proposal_reject", { proposal_id: proposalId }),
638
+ // Extensions
639
+ listExtensions: (type) => callTool("editor-ext_list", { type }),
640
+ runCommand: (extensionId, filePath, content, selection) => callTool("editor-ext_run_command", { extension_id: extensionId, file_path: filePath, content, selection }),
641
+ runDiagnostics: (filePath, content, extensionId, language) => callTool("editor-ext_run_diagnostics", { extension_id: extensionId, file_path: filePath, content, language }),
642
+ getCompletions: (filePath, content, line, column, prefix, language) => callTool("editor-ext_get_completions", { file_path: filePath, content, line, column, prefix, language })
643
+ };
644
+
645
+ exports.allTools = allTools;
646
+ exports.editor = editor;
647
+ exports.extensionTools = extensionTools;
648
+ exports.fileMutationTools = fileMutationTools;
649
+ exports.fileOperationTools = fileOperationTools;
650
+ exports.previewTools = previewTools;
651
+ exports.proposalTools = proposalTools;
652
+ exports.referenceTools = referenceTools;
653
+ exports.sessionTools = sessionTools;
654
+ exports.tools = tools;