@seastudio/sdk 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/bin/seastudio.js +0 -0
  2. package/dist/chunk-D7ONFXVY.js +98 -0
  3. package/dist/chunk-EIOFZMTC.cjs +109 -0
  4. package/dist/{chunk-AGBZJGTY.cjs → chunk-SUF5BPSK.cjs} +3 -1
  5. package/dist/{chunk-DDVRUPMZ.js → chunk-XU5GEWWL.js} +3 -1
  6. package/dist/develop-tool/cli/index.cjs +79 -7
  7. package/dist/develop-tool/cli/index.js +79 -7
  8. package/dist/index.cjs +42 -167
  9. package/dist/index.d.cts +2 -6
  10. package/dist/index.d.ts +2 -6
  11. package/dist/index.js +2 -7
  12. package/dist/mcp/core/index.d.cts +2 -2
  13. package/dist/mcp/core/index.d.ts +2 -2
  14. package/dist/mcp/index.cjs +27 -152
  15. package/dist/mcp/index.d.cts +12 -77
  16. package/dist/mcp/index.d.ts +12 -77
  17. package/dist/mcp/index.js +2 -7
  18. package/dist/mcp/seastudio/index.cjs +18 -18
  19. package/dist/mcp/seastudio/index.d.cts +34 -2
  20. package/dist/mcp/seastudio/index.d.ts +34 -2
  21. package/dist/mcp/seastudio/index.js +1 -1
  22. package/dist/{types-Clgf5gBf.d.cts → types-B32sUvc0.d.cts} +10 -2
  23. package/dist/{types-Clgf5gBf.d.ts → types-B32sUvc0.d.ts} +10 -2
  24. package/package.json +2 -22
  25. package/src/develop-tool/templates/plugin/frontend/package.json.tmpl +1 -1
  26. package/src/develop-tool/templates/plugin/frontend/src/main.tsx +3 -0
  27. package/src/develop-tool/templates/plugin/frontend/src/mcp-entry.ts.tmpl +12 -0
  28. package/dist/chunk-4ITOR5QE.js +0 -901
  29. package/dist/chunk-CSXDT47Y.cjs +0 -105
  30. package/dist/chunk-CVF4QHS6.cjs +0 -436
  31. package/dist/chunk-DSOSHJH2.js +0 -643
  32. package/dist/chunk-FLATZQA2.js +0 -174
  33. package/dist/chunk-HJJTBVKQ.cjs +0 -909
  34. package/dist/chunk-ISI2OLPI.cjs +0 -179
  35. package/dist/chunk-MYURVLGP.cjs +0 -165
  36. package/dist/chunk-QD4KISXM.js +0 -160
  37. package/dist/chunk-SNGU4SHO.cjs +0 -654
  38. package/dist/chunk-V7MNKGS7.js +0 -94
  39. package/dist/chunk-Z7LV7DCO.js +0 -429
  40. package/dist/mcp/plugin-editor/index.cjs +0 -47
  41. package/dist/mcp/plugin-editor/index.d.cts +0 -98
  42. package/dist/mcp/plugin-editor/index.d.ts +0 -98
  43. package/dist/mcp/plugin-editor/index.js +0 -2
  44. package/dist/mcp/plugin-excel/index.cjs +0 -31
  45. package/dist/mcp/plugin-excel/index.d.cts +0 -86
  46. package/dist/mcp/plugin-excel/index.d.ts +0 -86
  47. package/dist/mcp/plugin-excel/index.js +0 -2
  48. package/dist/mcp/plugin-preview/index.cjs +0 -23
  49. package/dist/mcp/plugin-preview/index.d.cts +0 -109
  50. package/dist/mcp/plugin-preview/index.d.ts +0 -109
  51. package/dist/mcp/plugin-preview/index.js +0 -2
  52. package/dist/mcp/plugin-seaflow/index.cjs +0 -35
  53. package/dist/mcp/plugin-seaflow/index.d.cts +0 -318
  54. package/dist/mcp/plugin-seaflow/index.d.ts +0 -318
  55. package/dist/mcp/plugin-seaflow/index.js +0 -2
  56. package/dist/tools-LMW67LIY.js +0 -2
  57. package/dist/tools-TU7PBMDO.cjs +0 -23
@@ -1,94 +0,0 @@
1
- import { allTools as allTools$2 } from './chunk-4ITOR5QE.js';
2
- import { allTools } from './chunk-DDVRUPMZ.js';
3
- import { tools as tools$1 } from './chunk-FLATZQA2.js';
4
- import { allTools as allTools$1 } from './chunk-DSOSHJH2.js';
5
- import { allTools as allTools$3 } from './chunk-Z7LV7DCO.js';
6
- import { tools } from './chunk-QD4KISXM.js';
7
- import { normalizeMCPTool, normalizeMCPToolObjectSchema } from './chunk-ANWOL7SM.js';
8
-
9
- // src/mcp/index.ts
10
- async function loadPlugin(pluginName) {
11
- switch (pluginName) {
12
- case "seastudio":
13
- return import('./mcp/seastudio/index.js');
14
- case "plugin-editor":
15
- case "editor":
16
- return import('./mcp/plugin-editor/index.js');
17
- case "plugin-preview":
18
- case "preview":
19
- return import('./mcp/plugin-preview/index.js');
20
- case "plugin-seaflow":
21
- case "seaflow":
22
- return import('./mcp/plugin-seaflow/index.js');
23
- case "plugin-shell":
24
- case "shell":
25
- return import('./tools-LMW67LIY.js');
26
- case "plugin-excel":
27
- case "excel":
28
- return import('./mcp/plugin-excel/index.js');
29
- default:
30
- throw new Error(`Unknown plugin: ${pluginName}`);
31
- }
32
- }
33
- var MCP_PACKAGES = [
34
- { id: "seastudio", name: "SeaStudio", description: "\u6587\u4EF6/Shell/Git \u57FA\u7840\u80FD\u529B", tools: allTools },
35
- { id: "codeEditor", name: "Code Editor", description: "\u4EE3\u7801\u7F16\u8F91\u5668\u80FD\u529B", tools: allTools$1 },
36
- { id: "preview", name: "Preview", description: "\u9884\u89C8\u5668\u80FD\u529B", tools },
37
- { id: "seaflow", name: "SeaFlow", description: "\u6D41\u7A0B\u753B\u5E03\u6267\u884C\u4E0E\u7F16\u6392\u80FD\u529B", tools: allTools$2 },
38
- { id: "shell", name: "Shell", description: "Shell \u4F1A\u8BDD\u4E0E\u547D\u4EE4\u6267\u884C\u80FD\u529B", tools: tools$1 },
39
- { id: "excel", name: "Excel", description: "Excel \u7535\u5B50\u8868\u683C\u64CD\u4F5C\u80FD\u529B", tools: allTools$3 }
40
- ];
41
- function mcpToolToOpenAI(tool) {
42
- const normalizedTool = normalizeMCPTool(tool);
43
- const outputSchema = normalizedTool.outputSchema ? normalizeMCPToolObjectSchema(normalizedTool.outputSchema) : void 0;
44
- return {
45
- type: "function",
46
- ...normalizedTool.annotations ? { annotations: { ...normalizedTool.annotations } } : {},
47
- ...outputSchema ? { outputSchema } : {},
48
- function: {
49
- name: normalizedTool.name,
50
- description: normalizedTool.description,
51
- parameters: normalizeMCPToolObjectSchema(normalizedTool.inputSchema),
52
- ...outputSchema ? { outputSchema } : {}
53
- }
54
- };
55
- }
56
- function listAllTools() {
57
- const tools7 = [];
58
- for (const pkg of MCP_PACKAGES) {
59
- tools7.push(...pkg.tools);
60
- }
61
- return tools7;
62
- }
63
- var listAvailableTools = listAllTools;
64
- var MCP_TOOL_PACKAGE_INDEX = new Map(
65
- MCP_PACKAGES.flatMap((pkg) => pkg.tools.map((tool) => [tool.name, pkg.id]))
66
- );
67
- function getMCPToolPackageIndex() {
68
- return new Map(MCP_TOOL_PACKAGE_INDEX);
69
- }
70
- function getMCPPackageIdForTool(toolName) {
71
- return MCP_TOOL_PACKAGE_INDEX.get(toolName) ?? null;
72
- }
73
- function listAvailableToolsForLLM() {
74
- return listAvailableTools().map(mcpToolToOpenAI);
75
- }
76
- function getMCPPackages() {
77
- return MCP_PACKAGES.map((pkg) => ({
78
- id: pkg.id,
79
- name: pkg.name,
80
- description: pkg.description,
81
- toolCount: pkg.tools.length
82
- }));
83
- }
84
- function getToolsForLLM(disabledPackages) {
85
- const tools7 = [];
86
- for (const pkg of MCP_PACKAGES) {
87
- if (!disabledPackages.has(pkg.id)) {
88
- tools7.push(...pkg.tools.map(mcpToolToOpenAI));
89
- }
90
- }
91
- return tools7;
92
- }
93
-
94
- export { MCP_PACKAGES, getMCPPackageIdForTool, getMCPPackages, getMCPToolPackageIndex, getToolsForLLM, listAllTools, listAvailableTools, listAvailableToolsForLLM, loadPlugin, mcpToolToOpenAI };
@@ -1,429 +0,0 @@
1
- import { getDefaultClient } from './chunk-ANWOL7SM.js';
2
-
3
- // src/mcp/plugin-excel/tools.ts
4
- function annotateTool(tool, annotations, outputSchema) {
5
- return {
6
- ...tool,
7
- annotations,
8
- ...{}
9
- };
10
- }
11
- var rangeSchema = {
12
- type: "object",
13
- description: 'A1 notation or row/col/height/width. Examples: { "a1": "B2:D8" } or { "row": 1, "col": 1, "height": 7, "width": 3 }',
14
- properties: {
15
- a1: { type: "string", description: 'A1 range notation, e.g. "B2:D8" or "A1"' },
16
- row: { type: "number", description: "0-based start row" },
17
- col: { type: "number", description: "0-based start column" },
18
- height: { type: "number", description: "Number of rows (default 1)" },
19
- width: { type: "number", description: "Number of columns (default 1)" }
20
- }
21
- };
22
- var sheetSchema = {
23
- type: "object",
24
- description: "Sheet identifier: by name or index",
25
- properties: {
26
- by: { type: "string", enum: ["name", "index"], description: "Lookup method" },
27
- value: { description: "Sheet name (string) or index (number)" }
28
- },
29
- required: ["by", "value"]
30
- };
31
- var styleSchema = {
32
- type: "object",
33
- description: "Partial CellStyle to apply",
34
- properties: {
35
- fontSize: { type: "number" },
36
- bold: { type: "boolean" },
37
- italic: { type: "boolean" },
38
- underline: { type: "boolean" },
39
- textColor: { type: "string", description: 'Hex color, e.g. "#FF0000"' },
40
- backgroundColor: { type: "string", description: "Hex color" },
41
- horizontalAlign: { type: "string", enum: ["left", "center", "right"] }
42
- }
43
- };
44
- var readTools = [
45
- annotateTool({
46
- name: "excel-workbook_get_context",
47
- description: "\u83B7\u53D6\u5F53\u524D\u5DE5\u4F5C\u7C3F\u4E0A\u4E0B\u6587\u4FE1\u606F\uFF1A\u6587\u4EF6\u8DEF\u5F84\u3001\u7C7B\u578B\u3001\u6D3B\u8DC3 Sheet\u3001\u884C\u5217\u6570\u3001\u7248\u672C\u53F7\u7B49\u3002",
48
- inputSchema: { type: "object", properties: {} }
49
- }, { operationKind: "read", rawDomain: "excel" }),
50
- annotateTool({
51
- name: "excel-workbook_list_sheets",
52
- description: "\u5217\u51FA\u5F53\u524D\u5DE5\u4F5C\u7C3F\u6240\u6709 Sheet \u540D\u79F0\u3001\u884C\u5217\u6570\u4E0E\u5408\u5E76\u533A\u57DF\u6570\u3002",
53
- inputSchema: { type: "object", properties: {} }
54
- }, { operationKind: "read", rawDomain: "excel" }),
55
- annotateTool({
56
- name: "excel-selection_get",
57
- description: "\u83B7\u53D6\u5F53\u524D\u7528\u6237\u9009\u533A\u4FE1\u606F\uFF08A1 \u8868\u793A\u6CD5\u4E0E 0-based bounds\uFF09\u3002",
58
- inputSchema: { type: "object", properties: {} }
59
- }, { operationKind: "read", rawDomain: "excel" }),
60
- annotateTool({
61
- name: "excel-range_read",
62
- description: "\u8BFB\u53D6\u6307\u5B9A\u533A\u57DF\u7684\u503C\u3001\u6837\u5F0F\u4E0E\u5408\u5E76\u4FE1\u606F\u3002\u652F\u6301 A1 \u6216 row/col/height/width \u5B9A\u4F4D\u3002",
63
- inputSchema: {
64
- type: "object",
65
- properties: {
66
- range: rangeSchema,
67
- includeStyles: { type: "boolean", description: "\u662F\u5426\u5305\u542B\u6837\u5F0F\uFF08\u9ED8\u8BA4 false\uFF09" },
68
- includeMerges: { type: "boolean", description: "\u662F\u5426\u5305\u542B\u5408\u5E76\u4FE1\u606F\uFF08\u9ED8\u8BA4 false\uFF09" },
69
- maxCells: { type: "number", description: "\u6700\u5927\u5355\u5143\u683C\u6570\u9650\u5236\uFF08\u9ED8\u8BA4 50000\uFF09" }
70
- },
71
- required: ["range"]
72
- }
73
- }, { operationKind: "read", rawDomain: "excel" }),
74
- annotateTool({
75
- name: "excel-range_export_tsv",
76
- description: "\u5C06\u6307\u5B9A\u533A\u57DF\u5BFC\u51FA\u4E3A TSV \u6587\u672C\u3002",
77
- inputSchema: {
78
- type: "object",
79
- properties: { range: rangeSchema },
80
- required: ["range"]
81
- }
82
- }, { operationKind: "read", rawDomain: "excel" }),
83
- annotateTool({
84
- name: "excel-range_find",
85
- description: "\u5728\u6D3B\u8DC3 Sheet \u4E2D\u641C\u7D22\u5339\u914D\u7684\u5355\u5143\u683C\uFF0C\u8FD4\u56DE\u6240\u6709\u547D\u4E2D\u7684\u4F4D\u7F6E\u4E0E\u503C\u3002\u652F\u6301\u6A21\u7CCA/\u7CBE\u786E\u5339\u914D\u3001\u5927\u5C0F\u5199\u654F\u611F\u3001\u9650\u5B9A\u641C\u7D22\u533A\u57DF\u3002",
86
- inputSchema: {
87
- type: "object",
88
- properties: {
89
- query: { type: "string", description: "\u641C\u7D22\u5173\u952E\u5B57" },
90
- range: rangeSchema,
91
- matchCase: { type: "boolean", description: "\u662F\u5426\u533A\u5206\u5927\u5C0F\u5199\uFF08\u9ED8\u8BA4 false\uFF09" },
92
- matchExact: { type: "boolean", description: "\u662F\u5426\u7CBE\u786E\u5339\u914D\u6574\u4E2A\u5355\u5143\u683C\u503C\uFF08\u9ED8\u8BA4 false\uFF0C\u6A21\u7CCA\u5305\u542B\u5339\u914D\uFF09" },
93
- maxResults: { type: "number", description: "\u6700\u5927\u8FD4\u56DE\u6570\u91CF\uFF08\u9ED8\u8BA4 200\uFF09" }
94
- },
95
- required: ["query"]
96
- }
97
- }, { operationKind: "read", rawDomain: "excel" }),
98
- annotateTool({
99
- name: "excel-workbook_get_stats",
100
- description: "\u5BF9\u6307\u5B9A\u533A\u57DF\u505A\u6C47\u603B\u7EDF\u8BA1\uFF1Asum\u3001avg\u3001min\u3001max\u3001count\u3001nonEmpty\u3002",
101
- inputSchema: {
102
- type: "object",
103
- properties: { range: rangeSchema },
104
- required: ["range"]
105
- }
106
- }, { operationKind: "read", rawDomain: "excel" })
107
- ];
108
- var mutateTools = [
109
- annotateTool({
110
- name: "excel-sheet_create",
111
- description: "\u65B0\u5EFA\u4E00\u4E2A\u7A7A\u767D Sheet \u5E76\u5207\u6362\u4E3A\u6D3B\u8DC3 Sheet\u3002",
112
- inputSchema: {
113
- type: "object",
114
- properties: {
115
- name: { type: "string", description: "Sheet \u540D\u79F0\uFF08\u53EF\u9009\uFF0C\u9ED8\u8BA4\u81EA\u52A8\u547D\u540D\uFF09" }
116
- }
117
- }
118
- }, { operationKind: "mutate", rawDomain: "excel" }),
119
- annotateTool({
120
- name: "excel-sheet_delete",
121
- description: "\u5220\u9664\u6307\u5B9A Sheet\uFF08\u4E0D\u80FD\u5220\u9664\u6700\u540E\u4E00\u4E2A Sheet\uFF09\u3002",
122
- inputSchema: {
123
- type: "object",
124
- properties: { sheet: sheetSchema },
125
- required: ["sheet"]
126
- }
127
- }, { operationKind: "mutate", rawDomain: "excel" }),
128
- annotateTool({
129
- name: "excel-sheet_rename",
130
- description: "\u91CD\u547D\u540D\u6307\u5B9A Sheet\u3002",
131
- inputSchema: {
132
- type: "object",
133
- properties: {
134
- sheet: sheetSchema,
135
- newName: { type: "string", description: "\u65B0\u540D\u79F0" }
136
- },
137
- required: ["sheet", "newName"]
138
- }
139
- }, { operationKind: "mutate", rawDomain: "excel" }),
140
- annotateTool({
141
- name: "excel-sheet_activate",
142
- description: "\u5207\u6362\u6D3B\u8DC3 Sheet\u3002",
143
- inputSchema: {
144
- type: "object",
145
- properties: { sheet: sheetSchema },
146
- required: ["sheet"]
147
- }
148
- }, { operationKind: "mutate", rawDomain: "excel" }),
149
- annotateTool({
150
- name: "excel-sheet_duplicate",
151
- description: "\u590D\u5236\u6574\u4E2A Sheet\uFF08\u5305\u62EC\u503C\u3001\u6837\u5F0F\u3001\u5408\u5E76\uFF09\uFF0C\u65B0 Sheet \u6210\u4E3A\u6D3B\u8DC3 Sheet\u3002",
152
- inputSchema: {
153
- type: "object",
154
- properties: {
155
- sheet: sheetSchema,
156
- newName: { type: "string", description: '\u65B0 Sheet \u540D\u79F0\uFF08\u53EF\u9009\uFF0C\u9ED8\u8BA4 "\u539F\u540D (\u526F\u672C)"\uFF09' }
157
- },
158
- required: ["sheet"]
159
- }
160
- }, { operationKind: "mutate", rawDomain: "excel" }),
161
- annotateTool({
162
- name: "excel-selection_set",
163
- description: "\u8BBE\u7F6E\u5F53\u524D\u9009\u533A\u3002",
164
- inputSchema: {
165
- type: "object",
166
- properties: { range: rangeSchema },
167
- required: ["range"]
168
- }
169
- }, { operationKind: "mutate", rawDomain: "excel" }),
170
- annotateTool({
171
- name: "excel-range_write",
172
- description: "\u5411\u6307\u5B9A\u533A\u57DF\u5199\u5165\u503C\uFF08\u4E8C\u7EF4\u6570\u7EC4\uFF09\u3002",
173
- inputSchema: {
174
- type: "object",
175
- properties: {
176
- range: rangeSchema,
177
- values: { type: "array", description: "\u4E8C\u7EF4\u6570\u7EC4 CellValue[][]", items: { type: "array" } }
178
- },
179
- required: ["range", "values"]
180
- }
181
- }, { operationKind: "mutate", rawDomain: "excel" }),
182
- annotateTool({
183
- name: "excel-range_clear",
184
- description: "\u6E05\u7A7A\u6307\u5B9A\u533A\u57DF\u7684\u503C\u548C\u6837\u5F0F\u3002",
185
- inputSchema: {
186
- type: "object",
187
- properties: { range: rangeSchema },
188
- required: ["range"]
189
- }
190
- }, { operationKind: "mutate", rawDomain: "excel" }),
191
- annotateTool({
192
- name: "excel-range_apply_style",
193
- description: "\u4E3A\u6307\u5B9A\u533A\u57DF\u5E94\u7528\u6837\u5F0F\uFF08\u5B57\u4F53\u3001\u989C\u8272\u3001\u5BF9\u9F50\u7B49\uFF09\u3002",
194
- inputSchema: {
195
- type: "object",
196
- properties: {
197
- range: rangeSchema,
198
- style: styleSchema
199
- },
200
- required: ["range", "style"]
201
- }
202
- }, { operationKind: "mutate", rawDomain: "excel" }),
203
- annotateTool({
204
- name: "excel-range_merge",
205
- description: "\u5408\u5E76\u6307\u5B9A\u533A\u57DF\u7684\u5355\u5143\u683C\u3002",
206
- inputSchema: {
207
- type: "object",
208
- properties: { range: rangeSchema },
209
- required: ["range"]
210
- }
211
- }, { operationKind: "mutate", rawDomain: "excel" }),
212
- annotateTool({
213
- name: "excel-range_unmerge",
214
- description: "\u53D6\u6D88\u5408\u5E76\u6307\u5B9A\u533A\u57DF\u7684\u5355\u5143\u683C\u3002",
215
- inputSchema: {
216
- type: "object",
217
- properties: { range: rangeSchema },
218
- required: ["range"]
219
- }
220
- }, { operationKind: "mutate", rawDomain: "excel" }),
221
- annotateTool({
222
- name: "excel-range_copy",
223
- description: "\u590D\u5236\u6307\u5B9A\u6E90\u533A\u57DF\u5230\u76EE\u6807\u4F4D\u7F6E\uFF08\u503C+\u6837\u5F0F\uFF09\u3002",
224
- inputSchema: {
225
- type: "object",
226
- properties: {
227
- source: rangeSchema,
228
- targetRow: { type: "number", description: "\u76EE\u6807\u8D77\u59CB\u884C\uFF080-based\uFF09" },
229
- targetCol: { type: "number", description: "\u76EE\u6807\u8D77\u59CB\u5217\uFF080-based\uFF09" }
230
- },
231
- required: ["source", "targetRow", "targetCol"]
232
- }
233
- }, { operationKind: "mutate", rawDomain: "excel" }),
234
- annotateTool({
235
- name: "excel-range_move",
236
- description: "\u79FB\u52A8\u6307\u5B9A\u6E90\u533A\u57DF\u5230\u76EE\u6807\u4F4D\u7F6E\uFF08\u526A\u5207+\u7C98\u8D34\u8BED\u4E49\uFF09\u3002",
237
- inputSchema: {
238
- type: "object",
239
- properties: {
240
- source: rangeSchema,
241
- targetRow: { type: "number", description: "\u76EE\u6807\u8D77\u59CB\u884C\uFF080-based\uFF09" },
242
- targetCol: { type: "number", description: "\u76EE\u6807\u8D77\u59CB\u5217\uFF080-based\uFF09" }
243
- },
244
- required: ["source", "targetRow", "targetCol"]
245
- }
246
- }, { operationKind: "mutate", rawDomain: "excel" }),
247
- annotateTool({
248
- name: "excel-range_fill",
249
- description: "\u5C06\u6E90\u533A\u57DF\u7684\u503C\u548C\u6837\u5F0F\u5E73\u94FA\u586B\u5145\u5230\u76EE\u6807\u533A\u57DF\u3002",
250
- inputSchema: {
251
- type: "object",
252
- properties: {
253
- source: rangeSchema,
254
- dest: rangeSchema
255
- },
256
- required: ["source", "dest"]
257
- }
258
- }, { operationKind: "mutate", rawDomain: "excel" }),
259
- annotateTool({
260
- name: "excel-rows_insert",
261
- description: "\u5728\u6307\u5B9A\u4F4D\u7F6E\u63D2\u5165\u7A7A\u884C\u3002",
262
- inputSchema: {
263
- type: "object",
264
- properties: {
265
- at: { type: "number", description: "\u63D2\u5165\u4F4D\u7F6E\uFF080-based \u884C\u53F7\uFF09" },
266
- count: { type: "number", description: "\u63D2\u5165\u884C\u6570\uFF08\u9ED8\u8BA4 1\uFF09" }
267
- },
268
- required: ["at"]
269
- }
270
- }, { operationKind: "mutate", rawDomain: "excel" }),
271
- annotateTool({
272
- name: "excel-rows_delete",
273
- description: "\u5220\u9664\u6307\u5B9A\u4F4D\u7F6E\u7684\u884C\u3002",
274
- inputSchema: {
275
- type: "object",
276
- properties: {
277
- at: { type: "number", description: "\u8D77\u59CB\u884C\uFF080-based\uFF09" },
278
- count: { type: "number", description: "\u5220\u9664\u884C\u6570\uFF08\u9ED8\u8BA4 1\uFF09" }
279
- },
280
- required: ["at"]
281
- }
282
- }, { operationKind: "mutate", rawDomain: "excel" }),
283
- annotateTool({
284
- name: "excel-cols_insert",
285
- description: "\u5728\u6307\u5B9A\u4F4D\u7F6E\u63D2\u5165\u7A7A\u5217\u3002",
286
- inputSchema: {
287
- type: "object",
288
- properties: {
289
- at: { type: "number", description: "\u63D2\u5165\u4F4D\u7F6E\uFF080-based \u5217\u53F7\uFF09" },
290
- count: { type: "number", description: "\u63D2\u5165\u5217\u6570\uFF08\u9ED8\u8BA4 1\uFF09" }
291
- },
292
- required: ["at"]
293
- }
294
- }, { operationKind: "mutate", rawDomain: "excel" }),
295
- annotateTool({
296
- name: "excel-cols_delete",
297
- description: "\u5220\u9664\u6307\u5B9A\u4F4D\u7F6E\u7684\u5217\u3002",
298
- inputSchema: {
299
- type: "object",
300
- properties: {
301
- at: { type: "number", description: "\u8D77\u59CB\u5217\uFF080-based\uFF09" },
302
- count: { type: "number", description: "\u5220\u9664\u5217\u6570\uFF08\u9ED8\u8BA4 1\uFF09" }
303
- },
304
- required: ["at"]
305
- }
306
- }, { operationKind: "mutate", rawDomain: "excel" }),
307
- annotateTool({
308
- name: "excel-range_sort",
309
- description: "\u5BF9\u6307\u5B9A\u533A\u57DF\u6309\u67D0\u4E00\u5217\u6392\u5E8F\u3002\u652F\u6301\u5347\u5E8F/\u964D\u5E8F\uFF0C\u53EF\u8DF3\u8FC7\u8868\u5934\u884C\u3002",
310
- inputSchema: {
311
- type: "object",
312
- properties: {
313
- range: rangeSchema,
314
- sortCol: { type: "number", description: "\u6392\u5E8F\u4F9D\u636E\u5217\uFF080-based \u5217\u53F7\uFF09" },
315
- ascending: { type: "boolean", description: "\u662F\u5426\u5347\u5E8F\uFF08\u9ED8\u8BA4 true\uFF09" },
316
- hasHeader: { type: "boolean", description: "\u7B2C\u4E00\u884C\u662F\u5426\u4E3A\u8868\u5934\uFF08\u9ED8\u8BA4 false\uFF0C\u8868\u5934\u4E0D\u53C2\u4E0E\u6392\u5E8F\uFF09" }
317
- },
318
- required: ["range", "sortCol"]
319
- }
320
- }, { operationKind: "mutate", rawDomain: "excel" }),
321
- annotateTool({
322
- name: "excel-range_replace",
323
- description: "\u67E5\u627E\u5E76\u66FF\u6362\u6307\u5B9A\u533A\u57DF\u4E2D\u7684\u6587\u672C\u3002\u652F\u6301\u6A21\u7CCA/\u7CBE\u786E\u5339\u914D\u3001\u5927\u5C0F\u5199\u654F\u611F\u3002",
324
- inputSchema: {
325
- type: "object",
326
- properties: {
327
- query: { type: "string", description: "\u8981\u67E5\u627E\u7684\u6587\u672C" },
328
- replacement: { type: "string", description: "\u66FF\u6362\u4E3A\u7684\u6587\u672C" },
329
- range: rangeSchema,
330
- matchCase: { type: "boolean", description: "\u662F\u5426\u533A\u5206\u5927\u5C0F\u5199\uFF08\u9ED8\u8BA4 false\uFF09" },
331
- matchExact: { type: "boolean", description: "\u662F\u5426\u7CBE\u786E\u5339\u914D\u6574\u4E2A\u5355\u5143\u683C\uFF08\u9ED8\u8BA4 false\uFF09" },
332
- maxReplacements: { type: "number", description: "\u6700\u5927\u66FF\u6362\u6B21\u6570\uFF08\u9ED8\u8BA4 1000\uFF09" }
333
- },
334
- required: ["query", "replacement"]
335
- }
336
- }, { operationKind: "mutate", rawDomain: "excel" }),
337
- annotateTool({
338
- name: "excel-batch_apply",
339
- description: "\u6279\u91CF\u6267\u884C\u591A\u4E2A\u64CD\u4F5C\uFF08\u539F\u5B50\u5E8F\u5217\uFF09\u3002\u6BCF\u4E2A\u64CD\u4F5C\u5305\u542B type \u548C params\u3002",
340
- inputSchema: {
341
- type: "object",
342
- properties: {
343
- operations: {
344
- type: "array",
345
- description: "\u64CD\u4F5C\u5217\u8868",
346
- items: {
347
- type: "object",
348
- properties: {
349
- type: { type: "string", description: "\u64CD\u4F5C\u7C7B\u578B\uFF0C\u5982 range_write, range_clear, range_apply_style, range_merge, range_unmerge, range_copy, range_move, range_fill, rows_insert, rows_delete, cols_insert, cols_delete, sheet_activate, sheet_create, sheet_delete, sheet_rename, sheet_duplicate, range_sort, range_replace" },
350
- params: { type: "object", description: "\u64CD\u4F5C\u53C2\u6570", additionalProperties: true }
351
- },
352
- required: ["type", "params"]
353
- }
354
- }
355
- },
356
- required: ["operations"]
357
- }
358
- }, { operationKind: "mutate", rawDomain: "excel" })
359
- ];
360
- var lifecycleTools = [
361
- annotateTool({
362
- name: "excel-workbook_open_path",
363
- description: "\u6253\u5F00\u6307\u5B9A\u8DEF\u5F84\u7684\u5DE5\u4F5C\u7C3F\u6587\u4EF6\u3002",
364
- inputSchema: {
365
- type: "object",
366
- properties: { path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84" } },
367
- required: ["path"]
368
- }
369
- }, { operationKind: "mutate", rawDomain: "excel" }),
370
- annotateTool({
371
- name: "excel-workbook_save",
372
- description: "\u4FDD\u5B58\u5F53\u524D\u5DE5\u4F5C\u7C3F\u5230\u78C1\u76D8\u3002",
373
- inputSchema: { type: "object", properties: {} }
374
- }, { operationKind: "mutate", rawDomain: "excel" }),
375
- annotateTool({
376
- name: "excel-workbook_reload",
377
- description: "\u4ECE\u78C1\u76D8\u91CD\u65B0\u52A0\u8F7D\u5F53\u524D\u5DE5\u4F5C\u7C3F\uFF08\u4E22\u5F03\u5185\u5B58\u4E2D\u7684\u4FEE\u6539\uFF09\u3002",
378
- inputSchema: { type: "object", properties: {} }
379
- }, { operationKind: "mutate", rawDomain: "excel" })
380
- ];
381
- var tools = [...readTools, ...mutateTools, ...lifecycleTools];
382
- var allTools = tools;
383
- async function callTool(name, args = {}) {
384
- return getDefaultClient().callTool(name, args);
385
- }
386
- var excel = {
387
- // Read
388
- getContext: () => callTool("excel-workbook_get_context"),
389
- listSheets: () => callTool("excel-workbook_list_sheets"),
390
- getSelection: () => callTool("excel-selection_get"),
391
- readRange: (range, opts) => callTool("excel-range_read", { range, ...opts }),
392
- exportTsv: (range) => callTool("excel-range_export_tsv", { range }),
393
- find: (query, opts) => callTool("excel-range_find", { query, ...opts }),
394
- getStats: (range) => callTool("excel-workbook_get_stats", { range }),
395
- // Sheet management
396
- createSheet: (name) => callTool("excel-sheet_create", { name }),
397
- deleteSheet: (sheet) => callTool("excel-sheet_delete", { sheet }),
398
- renameSheet: (sheet, newName) => callTool("excel-sheet_rename", { sheet, newName }),
399
- activateSheet: (sheet) => callTool("excel-sheet_activate", { sheet }),
400
- duplicateSheet: (sheet, newName) => callTool("excel-sheet_duplicate", { sheet, newName }),
401
- // Selection & write
402
- setSelection: (range) => callTool("excel-selection_set", { range }),
403
- writeRange: (range, values) => callTool("excel-range_write", { range, values }),
404
- clearRange: (range) => callTool("excel-range_clear", { range }),
405
- applyStyle: (range, style) => callTool("excel-range_apply_style", { range, style }),
406
- // Merge
407
- merge: (range) => callTool("excel-range_merge", { range }),
408
- unmerge: (range) => callTool("excel-range_unmerge", { range }),
409
- // Copy / Move / Fill
410
- copyRange: (source, targetRow, targetCol) => callTool("excel-range_copy", { source, targetRow, targetCol }),
411
- moveRange: (source, targetRow, targetCol) => callTool("excel-range_move", { source, targetRow, targetCol }),
412
- fillRange: (source, dest) => callTool("excel-range_fill", { source, dest }),
413
- // Row / Col
414
- insertRows: (at, count) => callTool("excel-rows_insert", { at, count }),
415
- deleteRows: (at, count) => callTool("excel-rows_delete", { at, count }),
416
- insertCols: (at, count) => callTool("excel-cols_insert", { at, count }),
417
- deleteCols: (at, count) => callTool("excel-cols_delete", { at, count }),
418
- // Sort / Replace
419
- sortRange: (range, sortCol, opts) => callTool("excel-range_sort", { range, sortCol, ...opts }),
420
- replaceInRange: (query, replacement, opts) => callTool("excel-range_replace", { query, replacement, ...opts }),
421
- // Batch
422
- batchApply: (operations) => callTool("excel-batch_apply", { operations }),
423
- // Lifecycle
424
- openPath: (path) => callTool("excel-workbook_open_path", { path }),
425
- save: () => callTool("excel-workbook_save"),
426
- reload: () => callTool("excel-workbook_reload")
427
- };
428
-
429
- export { allTools, excel, lifecycleTools, mutateTools, readTools, tools };
@@ -1,47 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkSNGU4SHO_cjs = require('../../chunk-SNGU4SHO.cjs');
4
- require('../../chunk-TFOJLA2F.cjs');
5
-
6
-
7
-
8
- Object.defineProperty(exports, "allTools", {
9
- enumerable: true,
10
- get: function () { return chunkSNGU4SHO_cjs.allTools; }
11
- });
12
- Object.defineProperty(exports, "editor", {
13
- enumerable: true,
14
- get: function () { return chunkSNGU4SHO_cjs.editor; }
15
- });
16
- Object.defineProperty(exports, "extensionTools", {
17
- enumerable: true,
18
- get: function () { return chunkSNGU4SHO_cjs.extensionTools; }
19
- });
20
- Object.defineProperty(exports, "fileMutationTools", {
21
- enumerable: true,
22
- get: function () { return chunkSNGU4SHO_cjs.fileMutationTools; }
23
- });
24
- Object.defineProperty(exports, "fileOperationTools", {
25
- enumerable: true,
26
- get: function () { return chunkSNGU4SHO_cjs.fileOperationTools; }
27
- });
28
- Object.defineProperty(exports, "previewTools", {
29
- enumerable: true,
30
- get: function () { return chunkSNGU4SHO_cjs.previewTools; }
31
- });
32
- Object.defineProperty(exports, "proposalTools", {
33
- enumerable: true,
34
- get: function () { return chunkSNGU4SHO_cjs.proposalTools; }
35
- });
36
- Object.defineProperty(exports, "referenceTools", {
37
- enumerable: true,
38
- get: function () { return chunkSNGU4SHO_cjs.referenceTools; }
39
- });
40
- Object.defineProperty(exports, "sessionTools", {
41
- enumerable: true,
42
- get: function () { return chunkSNGU4SHO_cjs.sessionTools; }
43
- });
44
- Object.defineProperty(exports, "tools", {
45
- enumerable: true,
46
- get: function () { return chunkSNGU4SHO_cjs.tools; }
47
- });
@@ -1,98 +0,0 @@
1
- import { k as MCPToolResult, g as MCPTool } from '../../types-Clgf5gBf.cjs';
2
-
3
- /**
4
- * Editor Plugin MCP Tools
5
- *
6
- * Editor 插件提供的 MCP Tools(A 类插件,被动响应)
7
- * 覆盖编辑器会话/状态、文件操作、预览控制、轻量引用、AI proposal/diff 采纳。
8
- */
9
-
10
- declare const fileOperationTools: MCPTool[];
11
- declare const sessionTools: MCPTool[];
12
- declare const fileMutationTools: MCPTool[];
13
- declare const previewTools: MCPTool[];
14
- declare const referenceTools: MCPTool[];
15
- declare const proposalTools: MCPTool[];
16
- declare const extensionTools: MCPTool[];
17
- declare const tools: MCPTool[];
18
- declare const allTools: MCPTool[];
19
- declare const editor: {
20
- openFile: (path: string, line?: number, column?: number) => Promise<MCPToolResult>;
21
- saveFile: (path?: string) => Promise<MCPToolResult>;
22
- getDirtyFiles: () => Promise<MCPToolResult>;
23
- getEditingFile: () => Promise<MCPToolResult>;
24
- fileSaved: (path: string) => Promise<MCPToolResult>;
25
- fileEditing: (path: string) => Promise<MCPToolResult>;
26
- listOpenFiles: () => Promise<MCPToolResult>;
27
- getActiveFile: () => Promise<MCPToolResult>;
28
- focusFile: (fileKey: string) => Promise<MCPToolResult>;
29
- closeFile: (fileKey: string) => Promise<MCPToolResult>;
30
- saveAllFiles: () => Promise<MCPToolResult>;
31
- createFile: (path: string, content?: string, rootId?: string) => Promise<MCPToolResult>;
32
- createDir: (path: string) => Promise<MCPToolResult>;
33
- renamePath: (oldPath: string, newPath: string) => Promise<MCPToolResult>;
34
- deletePath: (path: string) => Promise<MCPToolResult>;
35
- writeFile: (path: string, content: string, rootId?: string) => Promise<MCPToolResult>;
36
- writeBatch: (changes: Array<{
37
- path: string;
38
- content: string;
39
- }>) => Promise<MCPToolResult>;
40
- getViewMode: (fileKey?: string) => Promise<MCPToolResult>;
41
- setViewMode: (mode: "edit" | "preview", fileKey?: string) => Promise<MCPToolResult>;
42
- renderMarkdownPreview: (path?: string) => Promise<MCPToolResult>;
43
- resolvePathReference: (path: string) => Promise<MCPToolResult>;
44
- openReference: (path: string) => Promise<MCPToolResult>;
45
- searchPaths: (query: string) => Promise<MCPToolResult>;
46
- createProposal: (title: string, files: unknown[]) => Promise<MCPToolResult>;
47
- listProposals: () => Promise<MCPToolResult>;
48
- getProposalDiff: (proposalId: string) => Promise<MCPToolResult>;
49
- applyProposalAll: (proposalId: string) => Promise<MCPToolResult>;
50
- applyProposalHunks: (proposalId: string, hunkIds: string[]) => Promise<MCPToolResult>;
51
- rejectProposal: (proposalId: string) => Promise<MCPToolResult>;
52
- listExtensions: (type?: string) => Promise<MCPToolResult>;
53
- runCommand: (extensionId: string, filePath?: string, content?: string, selection?: unknown) => Promise<MCPToolResult>;
54
- runDiagnostics: (filePath: string, content: string, extensionId?: string, language?: string) => Promise<MCPToolResult>;
55
- getCompletions: (filePath: string, content: string, line: number, column: number, prefix: string, language?: string) => Promise<MCPToolResult>;
56
- };
57
- interface EditorFileInfo {
58
- path: string;
59
- content?: string;
60
- isDirty?: boolean;
61
- }
62
- interface CodeSearchMatch {
63
- path: string;
64
- lineNumber: number;
65
- content: string;
66
- }
67
- interface CodeSearchResult {
68
- pattern: string;
69
- matchCount: number;
70
- matches: CodeSearchMatch[];
71
- }
72
- interface TestResult {
73
- command: string;
74
- exitCode: number;
75
- passed: boolean;
76
- stdout: string;
77
- stderr: string;
78
- summary?: string;
79
- }
80
- interface TypecheckResult {
81
- command: string;
82
- exitCode: number;
83
- passed: boolean;
84
- stdout: string;
85
- stderr: string;
86
- errorCount?: number;
87
- }
88
- interface LintResult {
89
- command: string;
90
- exitCode: number;
91
- passed: boolean;
92
- stdout: string;
93
- stderr: string;
94
- warningCount?: number;
95
- errorCount?: number;
96
- }
97
-
98
- export { type CodeSearchMatch, type CodeSearchResult, type EditorFileInfo, type LintResult, type TestResult, type TypecheckResult, allTools, editor, extensionTools, fileMutationTools, fileOperationTools, previewTools, proposalTools, referenceTools, sessionTools, tools };