@seastudio/sdk 3.0.2 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) 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/develop-tool/cli/index.cjs +79 -7
  5. package/dist/develop-tool/cli/index.js +79 -7
  6. package/dist/index.cjs +39 -189
  7. package/dist/index.d.cts +2 -7
  8. package/dist/index.d.ts +2 -7
  9. package/dist/index.js +1 -7
  10. package/dist/mcp/core/index.d.cts +2 -2
  11. package/dist/mcp/core/index.d.ts +2 -2
  12. package/dist/mcp/index.cjs +11 -161
  13. package/dist/mcp/index.d.cts +12 -83
  14. package/dist/mcp/index.d.ts +12 -83
  15. package/dist/mcp/index.js +1 -7
  16. package/dist/mcp/seastudio/index.d.cts +1 -1
  17. package/dist/mcp/seastudio/index.d.ts +1 -1
  18. package/dist/{types-B1Zqr-0Q.d.cts → types-B32sUvc0.d.cts} +9 -1
  19. package/dist/{types-B1Zqr-0Q.d.ts → types-B32sUvc0.d.ts} +9 -1
  20. package/package.json +2 -22
  21. package/src/develop-tool/templates/plugin/frontend/package.json.tmpl +1 -1
  22. package/src/develop-tool/templates/plugin/frontend/src/main.tsx +3 -0
  23. package/src/develop-tool/templates/plugin/frontend/src/mcp-entry.ts.tmpl +12 -0
  24. package/dist/chunk-4ITOR5QE.js +0 -901
  25. package/dist/chunk-CVF4QHS6.cjs +0 -436
  26. package/dist/chunk-DSOSHJH2.js +0 -643
  27. package/dist/chunk-FLATZQA2.js +0 -174
  28. package/dist/chunk-G66KY35N.js +0 -334
  29. package/dist/chunk-HJJTBVKQ.cjs +0 -909
  30. package/dist/chunk-ISI2OLPI.cjs +0 -179
  31. package/dist/chunk-MYURVLGP.cjs +0 -165
  32. package/dist/chunk-ORBVHAAS.cjs +0 -341
  33. package/dist/chunk-QD4KISXM.js +0 -160
  34. package/dist/chunk-S2UIBWKA.js +0 -99
  35. package/dist/chunk-SNGU4SHO.cjs +0 -654
  36. package/dist/chunk-XIPL7VSP.cjs +0 -110
  37. package/dist/chunk-Z7LV7DCO.js +0 -429
  38. package/dist/mcp/plugin-editor/index.cjs +0 -47
  39. package/dist/mcp/plugin-editor/index.d.cts +0 -98
  40. package/dist/mcp/plugin-editor/index.d.ts +0 -98
  41. package/dist/mcp/plugin-editor/index.js +0 -2
  42. package/dist/mcp/plugin-excel/index.cjs +0 -31
  43. package/dist/mcp/plugin-excel/index.d.cts +0 -86
  44. package/dist/mcp/plugin-excel/index.d.ts +0 -86
  45. package/dist/mcp/plugin-excel/index.js +0 -2
  46. package/dist/mcp/plugin-preview/index.cjs +0 -23
  47. package/dist/mcp/plugin-preview/index.d.cts +0 -109
  48. package/dist/mcp/plugin-preview/index.d.ts +0 -109
  49. package/dist/mcp/plugin-preview/index.js +0 -2
  50. package/dist/mcp/plugin-seaflow/index.cjs +0 -35
  51. package/dist/mcp/plugin-seaflow/index.d.cts +0 -318
  52. package/dist/mcp/plugin-seaflow/index.d.ts +0 -318
  53. package/dist/mcp/plugin-seaflow/index.js +0 -2
  54. package/dist/mcp/plugin-word/index.cjs +0 -31
  55. package/dist/mcp/plugin-word/index.d.cts +0 -86
  56. package/dist/mcp/plugin-word/index.d.ts +0 -86
  57. package/dist/mcp/plugin-word/index.js +0 -2
  58. package/dist/tools-LMW67LIY.js +0 -2
  59. package/dist/tools-TU7PBMDO.cjs +0 -23
@@ -1,110 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkORBVHAAS_cjs = require('./chunk-ORBVHAAS.cjs');
4
- var chunkHJJTBVKQ_cjs = require('./chunk-HJJTBVKQ.cjs');
5
- var chunkSUF5BPSK_cjs = require('./chunk-SUF5BPSK.cjs');
6
- var chunkISI2OLPI_cjs = require('./chunk-ISI2OLPI.cjs');
7
- var chunkCVF4QHS6_cjs = require('./chunk-CVF4QHS6.cjs');
8
- var chunkMYURVLGP_cjs = require('./chunk-MYURVLGP.cjs');
9
- var chunkSNGU4SHO_cjs = require('./chunk-SNGU4SHO.cjs');
10
- var chunkTFOJLA2F_cjs = require('./chunk-TFOJLA2F.cjs');
11
-
12
- // src/mcp/index.ts
13
- async function loadPlugin(pluginName) {
14
- switch (pluginName) {
15
- case "seastudio":
16
- return import('./mcp/seastudio/index.cjs');
17
- case "plugin-editor":
18
- case "editor":
19
- return import('./mcp/plugin-editor/index.cjs');
20
- case "plugin-preview":
21
- case "preview":
22
- return import('./mcp/plugin-preview/index.cjs');
23
- case "plugin-seaflow":
24
- case "seaflow":
25
- return import('./mcp/plugin-seaflow/index.cjs');
26
- case "plugin-shell":
27
- case "shell":
28
- return import('./tools-TU7PBMDO.cjs');
29
- case "plugin-excel":
30
- case "excel":
31
- return import('./mcp/plugin-excel/index.cjs');
32
- case "plugin-word":
33
- case "word":
34
- return import('./mcp/plugin-word/index.cjs');
35
- default:
36
- throw new Error(`Unknown plugin: ${pluginName}`);
37
- }
38
- }
39
- var MCP_PACKAGES = [
40
- { id: "seastudio", name: "SeaStudio", description: "\u6587\u4EF6/Shell/Git \u57FA\u7840\u80FD\u529B", tools: chunkSUF5BPSK_cjs.allTools },
41
- { id: "codeEditor", name: "Code Editor", description: "\u4EE3\u7801\u7F16\u8F91\u5668\u80FD\u529B", tools: chunkSNGU4SHO_cjs.allTools },
42
- { id: "preview", name: "Preview", description: "\u9884\u89C8\u5668\u80FD\u529B", tools: chunkMYURVLGP_cjs.tools },
43
- { id: "seaflow", name: "SeaFlow", description: "\u6D41\u7A0B\u753B\u5E03\u6267\u884C\u4E0E\u7F16\u6392\u80FD\u529B", tools: chunkHJJTBVKQ_cjs.allTools },
44
- { id: "shell", name: "Shell", description: "Shell \u4F1A\u8BDD\u4E0E\u547D\u4EE4\u6267\u884C\u80FD\u529B", tools: chunkISI2OLPI_cjs.tools },
45
- { id: "excel", name: "Excel", description: "Excel \u7535\u5B50\u8868\u683C\u64CD\u4F5C\u80FD\u529B", tools: chunkCVF4QHS6_cjs.allTools },
46
- { id: "word", name: "Word", description: "Word \u6587\u6863\u7F16\u8F91\u80FD\u529B", tools: chunkORBVHAAS_cjs.allTools }
47
- ];
48
- function mcpToolToOpenAI(tool) {
49
- const normalizedTool = chunkTFOJLA2F_cjs.normalizeMCPTool(tool);
50
- const outputSchema = normalizedTool.outputSchema ? chunkTFOJLA2F_cjs.normalizeMCPToolObjectSchema(normalizedTool.outputSchema) : void 0;
51
- return {
52
- type: "function",
53
- ...normalizedTool.annotations ? { annotations: { ...normalizedTool.annotations } } : {},
54
- ...outputSchema ? { outputSchema } : {},
55
- function: {
56
- name: normalizedTool.name,
57
- description: normalizedTool.description,
58
- parameters: chunkTFOJLA2F_cjs.normalizeMCPToolObjectSchema(normalizedTool.inputSchema),
59
- ...outputSchema ? { outputSchema } : {}
60
- }
61
- };
62
- }
63
- function listAllTools() {
64
- const tools8 = [];
65
- for (const pkg of MCP_PACKAGES) {
66
- tools8.push(...pkg.tools);
67
- }
68
- return tools8;
69
- }
70
- var listAvailableTools = listAllTools;
71
- var MCP_TOOL_PACKAGE_INDEX = new Map(
72
- MCP_PACKAGES.flatMap((pkg) => pkg.tools.map((tool) => [tool.name, pkg.id]))
73
- );
74
- function getMCPToolPackageIndex() {
75
- return new Map(MCP_TOOL_PACKAGE_INDEX);
76
- }
77
- function getMCPPackageIdForTool(toolName) {
78
- return MCP_TOOL_PACKAGE_INDEX.get(toolName) ?? null;
79
- }
80
- function listAvailableToolsForLLM() {
81
- return listAvailableTools().map(mcpToolToOpenAI);
82
- }
83
- function getMCPPackages() {
84
- return MCP_PACKAGES.map((pkg) => ({
85
- id: pkg.id,
86
- name: pkg.name,
87
- description: pkg.description,
88
- toolCount: pkg.tools.length
89
- }));
90
- }
91
- function getToolsForLLM(disabledPackages) {
92
- const tools8 = [];
93
- for (const pkg of MCP_PACKAGES) {
94
- if (!disabledPackages.has(pkg.id)) {
95
- tools8.push(...pkg.tools.map(mcpToolToOpenAI));
96
- }
97
- }
98
- return tools8;
99
- }
100
-
101
- exports.MCP_PACKAGES = MCP_PACKAGES;
102
- exports.getMCPPackageIdForTool = getMCPPackageIdForTool;
103
- exports.getMCPPackages = getMCPPackages;
104
- exports.getMCPToolPackageIndex = getMCPToolPackageIndex;
105
- exports.getToolsForLLM = getToolsForLLM;
106
- exports.listAllTools = listAllTools;
107
- exports.listAvailableTools = listAvailableTools;
108
- exports.listAvailableToolsForLLM = listAvailableToolsForLLM;
109
- exports.loadPlugin = loadPlugin;
110
- exports.mcpToolToOpenAI = 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
- });