@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,341 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkTFOJLA2F_cjs = require('./chunk-TFOJLA2F.cjs');
4
-
5
- // src/mcp/plugin-word/tools.ts
6
- function annotateTool(tool, annotations, outputSchema) {
7
- return {
8
- ...tool,
9
- annotations,
10
- ...{}
11
- };
12
- }
13
- var targetSchema = {
14
- type: "object",
15
- description: "Document target specifier. Use ONE of: blockId, headingText, from/to positions, or omit for current selection / whole document.",
16
- properties: {
17
- blockId: { type: "string", description: "Block-level node ID (returned by get_outline / content_read)" },
18
- blockIndex: { type: "number", description: "0-based top-level block index" },
19
- headingText: { type: "string", description: "Heading text to locate (first match)" },
20
- from: { type: "number", description: "ProseMirror absolute start position (inclusive)" },
21
- to: { type: "number", description: "ProseMirror absolute end position (exclusive)" }
22
- }
23
- };
24
- var inlineStyleSchema = {
25
- type: "object",
26
- description: "Inline formatting marks to apply",
27
- properties: {
28
- bold: { type: "boolean" },
29
- italic: { type: "boolean" },
30
- underline: { type: "boolean" },
31
- strike: { type: "boolean" },
32
- fontSize: { type: "string", description: 'Font size, e.g. "14px" or "12pt"' }
33
- }
34
- };
35
- var blockTypeSchema = {
36
- type: "object",
37
- description: "Block type specification",
38
- properties: {
39
- type: {
40
- type: "string",
41
- enum: ["paragraph", "heading", "bulletList", "orderedList", "blockquote", "codeBlock"],
42
- description: "Target block type"
43
- },
44
- attrs: {
45
- type: "object",
46
- description: 'Block attributes, e.g. { "level": 2 } for heading',
47
- properties: {
48
- level: { type: "number", description: "Heading level 1-6 (only for heading type)" }
49
- }
50
- }
51
- },
52
- required: ["type"]
53
- };
54
- var readTools = [
55
- annotateTool({
56
- name: "word-document_get_context",
57
- description: "\u83B7\u53D6\u5F53\u524D Word \u6587\u6863\u4E0A\u4E0B\u6587\u4FE1\u606F\uFF1A\u6587\u4EF6\u8DEF\u5F84\u3001\u6587\u4EF6\u7C7B\u578B\uFF08docx/doc\uFF09\u3001\u662F\u5426\u5DF2\u4FEE\u6539\u3001\u7248\u672C\u53F7\u3001\u603B\u5757\u6570\u3001\u603B\u5B57\u7B26\u6570\u3001\u6807\u9898\u6570\u91CF\u4EE5\u53CA\u5F53\u524D\u9009\u533A\u6458\u8981\u3002\u8FD9\u662F Agent \u64CD\u4F5C Word \u6587\u6863\u7684\u7B2C\u4E00\u6B65\uFF0C\u7528\u4E8E\u4E86\u89E3\u6587\u6863\u6574\u4F53\u72B6\u6001\u3002",
58
- inputSchema: { type: "object", properties: {} }
59
- }, { operationKind: "read", rawDomain: "word" }),
60
- annotateTool({
61
- name: "word-document_get_outline",
62
- description: "\u83B7\u53D6\u6587\u6863\u5927\u7EB2\u7ED3\u6784\uFF1A\u8FD4\u56DE\u6240\u6709\u9876\u5C42\u5757\u7684\u6709\u5E8F\u5217\u8868\uFF0C\u6BCF\u4E2A\u5757\u5305\u542B blockId\u3001blockIndex\u3001blockType\uFF08paragraph/heading/bulletList/orderedList/blockquote/codeBlock\uFF09\u3001\u6587\u672C\u6458\u8981\uFF08\u622A\u65AD\u5230 80 \u5B57\u7B26\uFF09\u3001\u5B57\u7B26\u6570\u3002\u6807\u9898\u5757\u989D\u5916\u8FD4\u56DE level\uFF081-6\uFF09\u3002\u652F\u6301 maxBlocks \u9650\u5236\u8FD4\u56DE\u6570\u91CF\u3002Agent \u5E94\u5148\u8C03\u7528\u6B64\u5DE5\u5177\u4E86\u89E3\u6587\u6863\u7ED3\u6784\uFF0C\u518D\u7528 blockId \u6216 blockIndex \u7CBE\u786E\u5B9A\u4F4D\u64CD\u4F5C\u3002",
63
- inputSchema: {
64
- type: "object",
65
- properties: {
66
- maxBlocks: { type: "number", description: "\u6700\u5927\u8FD4\u56DE\u5757\u6570\uFF08\u9ED8\u8BA4 200\uFF09" },
67
- offset: { type: "number", description: "\u8DF3\u8FC7\u524D N \u4E2A\u5757\uFF08\u9ED8\u8BA4 0\uFF0C\u7528\u4E8E\u5206\u9875\uFF09" }
68
- }
69
- }
70
- }, { operationKind: "read", rawDomain: "word" }),
71
- annotateTool({
72
- name: "word-selection_get",
73
- description: "\u83B7\u53D6\u5F53\u524D\u7528\u6237\u9009\u533A\u4FE1\u606F\uFF1A\u9009\u4E2D\u6587\u672C\uFF08plainText\uFF09\u3001\u9009\u533A from/to \u4F4D\u7F6E\u3001\u9009\u533A\u6240\u5728\u7684\u5757 ID \u5217\u8868\u3002\u82E5\u65E0\u9009\u533A\u5219\u8FD4\u56DE\u5149\u6807\u4F4D\u7F6E\u3002",
74
- inputSchema: { type: "object", properties: {} }
75
- }, { operationKind: "read", rawDomain: "word" }),
76
- annotateTool({
77
- name: "word-content_read",
78
- description: "\u8BFB\u53D6\u6587\u6863\u5185\u5BB9\u3002\u53EF\u6309\u5168\u6587\u3001blockId\u3001blockIndex\u3001headingText \u6216 from/to \u8303\u56F4\u8BFB\u53D6\u3002\u8FD4\u56DE\u7EAF\u6587\u672C + \u5757\u7ED3\u6784\u4FE1\u606F\u3002\u652F\u6301 maxChars \u9650\u6D41\uFF08\u9ED8\u8BA4 50000\uFF09\u3002\u5EFA\u8BAE Agent \u5148\u7528 get_outline \u83B7\u53D6\u5757\u5217\u8868\uFF0C\u518D\u7528 blockId \u7CBE\u786E\u8BFB\u53D6\u611F\u5174\u8DA3\u7684\u90E8\u5206\uFF0C\u907F\u514D\u4E00\u6B21\u6027\u52A0\u8F7D\u6574\u7BC7\u5927\u6587\u6863\u3002",
79
- inputSchema: {
80
- type: "object",
81
- properties: {
82
- target: targetSchema,
83
- maxChars: { type: "number", description: "\u6700\u5927\u8FD4\u56DE\u5B57\u7B26\u6570\uFF08\u9ED8\u8BA4 50000\uFF09" },
84
- includeBlockInfo: { type: "boolean", description: "\u662F\u5426\u5305\u542B\u6BCF\u4E2A\u5757\u7684 blockId/blockType \u4FE1\u606F\uFF08\u9ED8\u8BA4 true\uFF09" }
85
- }
86
- }
87
- }, { operationKind: "read", rawDomain: "word" }),
88
- annotateTool({
89
- name: "word-content_export_text",
90
- description: "\u5C06\u6587\u6863\uFF08\u6216\u6307\u5B9A\u8303\u56F4\uFF09\u5BFC\u51FA\u4E3A\u7EAF\u6587\u672C\u5B57\u7B26\u4E32\u3002\u6BB5\u843D\u4E4B\u95F4\u7528\u6362\u884C\u5206\u9694\u3002\u652F\u6301 maxChars \u9650\u6D41\u3002",
91
- inputSchema: {
92
- type: "object",
93
- properties: {
94
- target: targetSchema,
95
- maxChars: { type: "number", description: "\u6700\u5927\u5B57\u7B26\u6570\uFF08\u9ED8\u8BA4 100000\uFF09" }
96
- }
97
- }
98
- }, { operationKind: "read", rawDomain: "word" }),
99
- annotateTool({
100
- name: "word-content_export_markdown",
101
- description: "\u5C06\u6587\u6863\uFF08\u6216\u6307\u5B9A\u8303\u56F4\uFF09\u5BFC\u51FA\u4E3A Markdown \u683C\u5F0F\u3002\u6807\u9898\u8F6C\u4E3A # \u8BED\u6CD5\uFF0C\u5217\u8868\u8F6C\u4E3A - / 1. \u8BED\u6CD5\uFF0C\u7C97\u4F53/\u659C\u4F53\u4FDD\u7559 Markdown \u6807\u8BB0\u3002\u652F\u6301 maxChars \u9650\u6D41\u3002",
102
- inputSchema: {
103
- type: "object",
104
- properties: {
105
- target: targetSchema,
106
- maxChars: { type: "number", description: "\u6700\u5927\u5B57\u7B26\u6570\uFF08\u9ED8\u8BA4 100000\uFF09" }
107
- }
108
- }
109
- }, { operationKind: "read", rawDomain: "word" }),
110
- annotateTool({
111
- name: "word-content_export_html",
112
- description: "\u5C06\u6587\u6863\uFF08\u6216\u6307\u5B9A\u8303\u56F4\uFF09\u5BFC\u51FA\u4E3A HTML \u5B57\u7B26\u4E32\u3002\u4FDD\u7559\u6240\u6709\u884C\u5185\u683C\u5F0F\u3002\u652F\u6301 maxChars \u9650\u6D41\u3002",
113
- inputSchema: {
114
- type: "object",
115
- properties: {
116
- target: targetSchema,
117
- maxChars: { type: "number", description: "\u6700\u5927\u5B57\u7B26\u6570\uFF08\u9ED8\u8BA4 100000\uFF09" }
118
- }
119
- }
120
- }, { operationKind: "read", rawDomain: "word" }),
121
- annotateTool({
122
- name: "word-find",
123
- description: "\u5728\u6587\u6863\u4E2D\u641C\u7D22\u6587\u672C\u3002\u8FD4\u56DE\u6240\u6709\u5339\u914D\u9879\u7684\u4F4D\u7F6E\uFF08from/to\uFF09\u3001\u6240\u5728\u5757 ID\u3001\u5339\u914D\u6587\u672C\u53CA\u5176\u524D\u540E\u4E0A\u4E0B\u6587\uFF08\u5404 40 \u5B57\u7B26\uFF09\u3002\u652F\u6301\u5927\u5C0F\u5199\u654F\u611F\u3001\u6B63\u5219\u6A21\u5F0F\u548C\u6700\u5927\u7ED3\u679C\u6570\u9650\u5236\u3002",
124
- inputSchema: {
125
- type: "object",
126
- properties: {
127
- query: { type: "string", description: "\u641C\u7D22\u5173\u952E\u5B57\u6216\u6B63\u5219\u8868\u8FBE\u5F0F" },
128
- matchCase: { type: "boolean", description: "\u662F\u5426\u533A\u5206\u5927\u5C0F\u5199\uFF08\u9ED8\u8BA4 false\uFF09" },
129
- useRegex: { type: "boolean", description: "\u662F\u5426\u5C06 query \u4F5C\u4E3A\u6B63\u5219\u8868\u8FBE\u5F0F\uFF08\u9ED8\u8BA4 false\uFF09" },
130
- target: targetSchema,
131
- maxResults: { type: "number", description: "\u6700\u5927\u8FD4\u56DE\u6570\u91CF\uFF08\u9ED8\u8BA4 100\uFF09" }
132
- },
133
- required: ["query"]
134
- }
135
- }, { operationKind: "read", rawDomain: "word" }),
136
- annotateTool({
137
- name: "word-styles_list",
138
- description: "\u5217\u51FA\u5F53\u524D\u7F16\u8F91\u5668\u652F\u6301\u7684\u5757\u7EA7\u7C7B\u578B\uFF08paragraph/heading/bulletList \u7B49\uFF09\u548C\u884C\u5185\u6807\u8BB0\uFF08bold/italic/underline/strike/fontSize\uFF09\u3002Agent \u53EF\u636E\u6B64\u5224\u65AD\u53EF\u7528\u7684\u683C\u5F0F\u5316\u80FD\u529B\u3002",
139
- inputSchema: { type: "object", properties: {} }
140
- }, { operationKind: "read", rawDomain: "word" })
141
- ];
142
- var mutateTools = [
143
- annotateTool({
144
- name: "word-selection_set",
145
- description: "\u8BBE\u7F6E\u5F53\u524D\u9009\u533A\u3002\u53EF\u901A\u8FC7 blockId \u9009\u4E2D\u6574\u4E2A\u5757\uFF0C\u901A\u8FC7 from/to \u9009\u4E2D\u7CBE\u786E\u8303\u56F4\uFF0C\u6216\u901A\u8FC7 headingText \u9009\u4E2D\u67D0\u4E2A\u6807\u9898\u5757\u3002",
146
- inputSchema: {
147
- type: "object",
148
- properties: { target: targetSchema },
149
- required: ["target"]
150
- }
151
- }, { operationKind: "mutate", rawDomain: "word" }),
152
- annotateTool({
153
- name: "word-content_replace",
154
- description: "\u66FF\u6362\u6307\u5B9A\u8303\u56F4\u7684\u5185\u5BB9\u4E3A\u65B0\u6587\u672C\u3002target \u6307\u5B9A\u66FF\u6362\u4F4D\u7F6E\uFF08blockId / from+to / \u5F53\u524D\u9009\u533A\uFF09\uFF0Ctext \u4E3A\u65B0\u5185\u5BB9\u3002\u82E5 target \u7701\u7565\u5219\u66FF\u6362\u5F53\u524D\u9009\u533A\u3002\u8FD4\u56DE MutationResult\u3002",
155
- inputSchema: {
156
- type: "object",
157
- properties: {
158
- target: targetSchema,
159
- text: { type: "string", description: "\u66FF\u6362\u4E3A\u7684\u65B0\u6587\u672C\u5185\u5BB9" }
160
- },
161
- required: ["text"]
162
- }
163
- }, { operationKind: "mutate", rawDomain: "word" }),
164
- annotateTool({
165
- name: "word-content_insert_text",
166
- description: "\u5728\u6307\u5B9A\u4F4D\u7F6E\u63D2\u5165\u6587\u672C\u3002position \u63A7\u5236\u63D2\u5165\u70B9\uFF1Aat \u6307\u5B9A\u7EDD\u5BF9\u4F4D\u7F6E\uFF0CafterBlock/beforeBlock \u6307\u5B9A\u5728\u67D0\u4E2A\u5757\u524D\u540E\u63D2\u5165\uFF0CatEnd \u63D2\u5165\u5230\u6587\u6863\u672B\u5C3E\u3002\u652F\u6301\u63D2\u5165\u7EAF\u6587\u672C\u6216\u5E26\u6362\u884C\u7684\u591A\u6BB5\u6587\u672C\u3002",
167
- inputSchema: {
168
- type: "object",
169
- properties: {
170
- text: { type: "string", description: "\u8981\u63D2\u5165\u7684\u6587\u672C\u5185\u5BB9" },
171
- at: { type: "number", description: "ProseMirror \u7EDD\u5BF9\u4F4D\u7F6E" },
172
- afterBlock: { type: "string", description: "\u5728\u6B64 blockId \u4E4B\u540E\u63D2\u5165" },
173
- beforeBlock: { type: "string", description: "\u5728\u6B64 blockId \u4E4B\u524D\u63D2\u5165" },
174
- atEnd: { type: "boolean", description: "\u63D2\u5165\u5230\u6587\u6863\u672B\u5C3E\uFF08\u9ED8\u8BA4 false\uFF09" }
175
- },
176
- required: ["text"]
177
- }
178
- }, { operationKind: "mutate", rawDomain: "word" }),
179
- annotateTool({
180
- name: "word-block_insert",
181
- description: "\u5728\u6307\u5B9A\u4F4D\u7F6E\u63D2\u5165\u4E00\u4E2A\u65B0\u7684\u5757\u7EA7\u8282\u70B9\uFF08\u6BB5\u843D\u3001\u6807\u9898\u3001\u5217\u8868\u3001\u5F15\u7528\u3001\u4EE3\u7801\u5757\uFF09\u3002\u53EF\u6307\u5B9A\u5728\u67D0\u4E2A blockId \u524D\u540E\u63D2\u5165\u6216\u5728\u6587\u6863\u672B\u5C3E\u8FFD\u52A0\u3002",
182
- inputSchema: {
183
- type: "object",
184
- properties: {
185
- blockType: blockTypeSchema,
186
- content: { type: "string", description: "\u5757\u7684\u6587\u672C\u5185\u5BB9" },
187
- afterBlock: { type: "string", description: "\u5728\u6B64 blockId \u4E4B\u540E\u63D2\u5165" },
188
- beforeBlock: { type: "string", description: "\u5728\u6B64 blockId \u4E4B\u524D\u63D2\u5165" },
189
- atEnd: { type: "boolean", description: "\u8FFD\u52A0\u5230\u6587\u6863\u672B\u5C3E\uFF08\u9ED8\u8BA4 false\uFF09" }
190
- },
191
- required: ["blockType", "content"]
192
- }
193
- }, { operationKind: "mutate", rawDomain: "word" }),
194
- annotateTool({
195
- name: "word-block_delete",
196
- description: "\u5220\u9664\u6307\u5B9A\u7684\u5757\u3002\u652F\u6301\u6309 blockId\u3001blockIndex \u6216 from/to \u8303\u56F4\u5220\u9664\u3002",
197
- inputSchema: {
198
- type: "object",
199
- properties: { target: targetSchema },
200
- required: ["target"]
201
- }
202
- }, { operationKind: "mutate", rawDomain: "word" }),
203
- annotateTool({
204
- name: "word-block_move",
205
- description: "\u79FB\u52A8\u4E00\u4E2A\u5757\u5230\u65B0\u4F4D\u7F6E\u3002\u6307\u5B9A\u6E90\u5757\uFF08by blockId \u6216 blockIndex\uFF09\u548C\u76EE\u6807\u4F4D\u7F6E\uFF08\u76EE\u6807 blockId \u4E4B\u524D\u6216\u4E4B\u540E\uFF09\u3002\u9002\u5408\u5927\u7EB2\u91CD\u6392\u3002",
206
- inputSchema: {
207
- type: "object",
208
- properties: {
209
- sourceBlockId: { type: "string", description: "\u8981\u79FB\u52A8\u7684\u5757 ID" },
210
- sourceBlockIndex: { type: "number", description: "\u8981\u79FB\u52A8\u7684\u5757\u7D22\u5F15\uFF08\u4E0E sourceBlockId \u4E8C\u9009\u4E00\uFF09" },
211
- targetBlockId: { type: "string", description: "\u76EE\u6807\u4F4D\u7F6E\u53C2\u8003\u5757 ID" },
212
- position: { type: "string", enum: ["before", "after"], description: "\u653E\u5728\u76EE\u6807\u5757\u4E4B\u524D\u8FD8\u662F\u4E4B\u540E\uFF08\u9ED8\u8BA4 after\uFF09" }
213
- }
214
- }
215
- }, { operationKind: "mutate", rawDomain: "word" }),
216
- annotateTool({
217
- name: "word-format_apply_inline",
218
- description: "\u5BF9\u6307\u5B9A\u8303\u56F4\u5E94\u7528\u884C\u5185\u683C\u5F0F\uFF08\u7C97\u4F53\u3001\u659C\u4F53\u3001\u4E0B\u5212\u7EBF\u3001\u5220\u9664\u7EBF\u3001\u5B57\u53F7\uFF09\u3002\u82E5 target \u7701\u7565\u5219\u4F5C\u7528\u4E8E\u5F53\u524D\u9009\u533A\u3002\u53EF\u7528 toggle \u6A21\u5F0F\uFF08\u5982 bold: true \u5F00\u542F\u3001bold: false \u5173\u95ED\uFF09\u3002",
219
- inputSchema: {
220
- type: "object",
221
- properties: {
222
- target: targetSchema,
223
- style: inlineStyleSchema
224
- },
225
- required: ["style"]
226
- }
227
- }, { operationKind: "mutate", rawDomain: "word" }),
228
- annotateTool({
229
- name: "word-format_set_block",
230
- description: "\u5C06\u6307\u5B9A\u5757\u7684\u7C7B\u578B\u8F6C\u6362\u4E3A\u53E6\u4E00\u79CD\u5757\u7C7B\u578B\u3002\u4F8B\u5982\u5C06\u6BB5\u843D\u8F6C\u4E3A\u6807\u9898\u3001\u5C06\u6BB5\u843D\u8F6C\u4E3A\u5217\u8868\u9879\u7B49\u3002\u82E5 target \u7701\u7565\u5219\u4F5C\u7528\u4E8E\u5F53\u524D\u5149\u6807\u6240\u5728\u5757\u3002",
231
- inputSchema: {
232
- type: "object",
233
- properties: {
234
- target: targetSchema,
235
- blockType: blockTypeSchema
236
- },
237
- required: ["blockType"]
238
- }
239
- }, { operationKind: "mutate", rawDomain: "word" }),
240
- annotateTool({
241
- name: "word-find_replace",
242
- description: "\u6279\u91CF\u67E5\u627E\u5E76\u66FF\u6362\u6587\u6863\u4E2D\u7684\u6587\u672C\u3002\u8FD4\u56DE\u66FF\u6362\u6B21\u6570\u3002\u652F\u6301\u5927\u5C0F\u5199\u654F\u611F\u548C\u6B63\u5219\u6A21\u5F0F\u3002",
243
- inputSchema: {
244
- type: "object",
245
- properties: {
246
- query: { type: "string", description: "\u8981\u67E5\u627E\u7684\u6587\u672C\u6216\u6B63\u5219\u8868\u8FBE\u5F0F" },
247
- replacement: { type: "string", description: "\u66FF\u6362\u4E3A\u7684\u6587\u672C" },
248
- matchCase: { type: "boolean", description: "\u662F\u5426\u533A\u5206\u5927\u5C0F\u5199\uFF08\u9ED8\u8BA4 false\uFF09" },
249
- useRegex: { type: "boolean", description: "\u662F\u5426\u5C06 query \u4F5C\u4E3A\u6B63\u5219\u8868\u8FBE\u5F0F\uFF08\u9ED8\u8BA4 false\uFF09" },
250
- target: targetSchema,
251
- maxReplacements: { type: "number", description: "\u6700\u5927\u66FF\u6362\u6B21\u6570\uFF08\u9ED8\u8BA4 1000\uFF09" }
252
- },
253
- required: ["query", "replacement"]
254
- }
255
- }, { operationKind: "mutate", rawDomain: "word" }),
256
- annotateTool({
257
- name: "word-batch_apply",
258
- description: "\u6279\u91CF\u6267\u884C\u591A\u4E2A\u64CD\u4F5C\uFF08\u987A\u5E8F\u6267\u884C\uFF09\u3002\u6BCF\u4E2A\u64CD\u4F5C\u5305\u542B type\uFF08\u5BF9\u5E94\u5DE5\u5177\u540D\u53BB\u6389 word- \u524D\u7F00\uFF09\u548C params\u3002\u8FD4\u56DE\u9010\u9879\u7ED3\u679C\u3002\u9002\u5408\u9700\u8981\u591A\u6B65\u7F16\u8F91\u7684\u573A\u666F\uFF0C\u51CF\u5C11\u5F80\u8FD4\u6B21\u6570\u3002",
259
- inputSchema: {
260
- type: "object",
261
- properties: {
262
- operations: {
263
- type: "array",
264
- description: "\u64CD\u4F5C\u5217\u8868",
265
- items: {
266
- type: "object",
267
- properties: {
268
- type: {
269
- type: "string",
270
- description: "\u64CD\u4F5C\u7C7B\u578B\uFF1Acontent_replace, content_insert_text, block_insert, block_delete, block_move, format_apply_inline, format_set_block, find_replace, selection_set"
271
- },
272
- params: { type: "object", description: "\u64CD\u4F5C\u53C2\u6570\uFF08\u4E0E\u5BF9\u5E94\u5355\u72EC\u5DE5\u5177\u7684 inputSchema \u4E00\u81F4\uFF09", additionalProperties: true }
273
- },
274
- required: ["type", "params"]
275
- }
276
- }
277
- },
278
- required: ["operations"]
279
- }
280
- }, { operationKind: "mutate", rawDomain: "word" })
281
- ];
282
- var lifecycleTools = [
283
- annotateTool({
284
- name: "word-document_open_path",
285
- description: "\u6253\u5F00\u6307\u5B9A\u8DEF\u5F84\u7684 Word \u6587\u6863\uFF08.docx \u6216 .doc\uFF09\u3002.doc \u6587\u4EF6\u4F1A\u81EA\u52A8\u8F6C\u6362\uFF0C\u540E\u7EED\u4FDD\u5B58\u4E3A .docx\u3002",
286
- inputSchema: {
287
- type: "object",
288
- properties: { path: { type: "string", description: "\u6587\u4EF6\u7EDD\u5BF9\u8DEF\u5F84" } },
289
- required: ["path"]
290
- }
291
- }, { operationKind: "mutate", rawDomain: "word" }),
292
- annotateTool({
293
- name: "word-document_save",
294
- description: "\u4FDD\u5B58\u5F53\u524D\u6587\u6863\u5230\u78C1\u76D8\u3002.doc \u5BFC\u5165\u7684\u6587\u4EF6\u4F1A\u81EA\u52A8\u4FDD\u5B58\u4E3A .docx \u683C\u5F0F\u3002",
295
- inputSchema: { type: "object", properties: {} }
296
- }, { operationKind: "mutate", rawDomain: "word" }),
297
- annotateTool({
298
- name: "word-document_reload",
299
- description: "\u4ECE\u78C1\u76D8\u91CD\u65B0\u52A0\u8F7D\u5F53\u524D\u6587\u6863\uFF08\u4E22\u5F03\u5185\u5B58\u4E2D\u672A\u4FDD\u5B58\u7684\u4FEE\u6539\uFF09\u3002",
300
- inputSchema: { type: "object", properties: {} }
301
- }, { operationKind: "mutate", rawDomain: "word" })
302
- ];
303
- var tools = [...readTools, ...mutateTools, ...lifecycleTools];
304
- var allTools = tools;
305
- async function callTool(name, args = {}) {
306
- return chunkTFOJLA2F_cjs.getDefaultClient().callTool(name, args);
307
- }
308
- var word = {
309
- // Read
310
- getContext: () => callTool("word-document_get_context"),
311
- getOutline: (opts) => callTool("word-document_get_outline", opts ?? {}),
312
- getSelection: () => callTool("word-selection_get"),
313
- readContent: (opts) => callTool("word-content_read", opts ?? {}),
314
- exportText: (opts) => callTool("word-content_export_text", opts ?? {}),
315
- exportMarkdown: (opts) => callTool("word-content_export_markdown", opts ?? {}),
316
- exportHtml: (opts) => callTool("word-content_export_html", opts ?? {}),
317
- find: (query, opts) => callTool("word-find", { query, ...opts }),
318
- listStyles: () => callTool("word-styles_list"),
319
- // Mutate
320
- setSelection: (target) => callTool("word-selection_set", { target }),
321
- replaceContent: (text, target) => callTool("word-content_replace", { text, ...target ? { target } : {} }),
322
- insertText: (text, opts) => callTool("word-content_insert_text", { text, ...opts }),
323
- insertBlock: (blockType, content, opts) => callTool("word-block_insert", { blockType, content, ...opts }),
324
- deleteBlock: (target) => callTool("word-block_delete", { target }),
325
- moveBlock: (opts) => callTool("word-block_move", opts),
326
- applyInlineFormat: (style, target) => callTool("word-format_apply_inline", { style, ...target ? { target } : {} }),
327
- setBlockType: (blockType, target) => callTool("word-format_set_block", { blockType, ...target ? { target } : {} }),
328
- findReplace: (query, replacement, opts) => callTool("word-find_replace", { query, replacement, ...opts }),
329
- batchApply: (operations) => callTool("word-batch_apply", { operations }),
330
- // Lifecycle
331
- openPath: (path) => callTool("word-document_open_path", { path }),
332
- save: () => callTool("word-document_save"),
333
- reload: () => callTool("word-document_reload")
334
- };
335
-
336
- exports.allTools = allTools;
337
- exports.lifecycleTools = lifecycleTools;
338
- exports.mutateTools = mutateTools;
339
- exports.readTools = readTools;
340
- exports.tools = tools;
341
- exports.word = word;
@@ -1,160 +0,0 @@
1
- import { getDefaultClient } from './chunk-ANWOL7SM.js';
2
-
3
- // src/mcp/plugin-preview/tools.ts
4
- var coreTools = [
5
- {
6
- name: "preview-get",
7
- description: "\u83B7\u53D6\u5A92\u4F53\u6587\u4EF6\uFF08\u56FE\u7247/\u89C6\u9891/\u97F3\u9891\uFF09\u7684\u9884\u89C8\u7ED3\u679C\uFF0C\u5305\u542B\u5143\u6570\u636E\u4E0E\u53EF\u6E32\u67D3 URL\u3002\u4E0D\u8981\u5BF9\u4EE3\u7801\u6216\u6587\u672C\u6587\u4EF6\u4F7F\u7528\u6B64\u5DE5\u5177\u3002",
8
- inputSchema: {
9
- type: "object",
10
- properties: {
11
- path: { type: "string", description: "\u5A92\u4F53\u6587\u4EF6\u8DEF\u5F84\uFF08\u56FE\u7247/\u89C6\u9891/\u97F3\u9891\uFF09" },
12
- rootId: { type: "string", enum: ["workspace"], description: "\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" }
13
- },
14
- required: ["path"]
15
- }
16
- },
17
- {
18
- name: "preview-resolve_capability",
19
- description: "\u68C0\u67E5\u6587\u4EF6\u662F\u5426\u4E3A\u53EF\u9884\u89C8\u7684\u5A92\u4F53\u7C7B\u578B\uFF08\u56FE\u7247/\u89C6\u9891/\u97F3\u9891\uFF09\uFF0C\u8FD4\u56DE\u5143\u6570\u636E",
20
- inputSchema: {
21
- type: "object",
22
- properties: {
23
- path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84" },
24
- rootId: { type: "string", enum: ["workspace"], description: "\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" }
25
- },
26
- required: ["path"]
27
- }
28
- },
29
- {
30
- name: "preview-get_metadata",
31
- description: "\u83B7\u53D6\u5A92\u4F53\u6587\u4EF6\u7684\u5143\u6570\u636E\uFF08MIME \u7C7B\u578B\u3001\u5927\u5C0F\u3001\u6269\u5C55\u540D\u7B49\uFF09",
32
- inputSchema: {
33
- type: "object",
34
- properties: {
35
- path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84" },
36
- rootId: { type: "string", enum: ["workspace"], description: "\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" }
37
- },
38
- required: ["path"]
39
- }
40
- },
41
- {
42
- name: "preview-get_thumbnail",
43
- description: "\u83B7\u53D6\u56FE\u7247\u6587\u4EF6\u7684\u7F29\u7565\u56FE URL\u3002\u4EC5\u5BF9\u56FE\u7247\u7C7B\u578B\u6709\u6548\u3002",
44
- inputSchema: {
45
- type: "object",
46
- properties: {
47
- path: { type: "string", description: "\u56FE\u7247\u6587\u4EF6\u8DEF\u5F84" },
48
- rootId: { type: "string", enum: ["workspace"], description: "\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" },
49
- width: { type: "number", description: "\u7F29\u7565\u56FE\u5BBD\u5EA6\uFF08\u53EF\u9009\uFF09" },
50
- height: { type: "number", description: "\u7F29\u7565\u56FE\u9AD8\u5EA6\uFF08\u53EF\u9009\uFF09" }
51
- },
52
- required: ["path"]
53
- }
54
- }
55
- ];
56
- var enhancedTools = [
57
- {
58
- name: "preview-file",
59
- description: "\u83B7\u53D6\u5355\u4E2A\u5A92\u4F53\u6587\u4EF6\uFF08\u56FE\u7247/\u89C6\u9891/\u97F3\u9891\uFF09\u7684\u6807\u51C6\u5316\u9884\u89C8\u7ED3\u679C",
60
- inputSchema: {
61
- type: "object",
62
- properties: {
63
- path: { type: "string", description: "\u5A92\u4F53\u6587\u4EF6\u8DEF\u5F84" },
64
- rootId: { type: "string", enum: ["workspace"], description: "\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" }
65
- },
66
- required: ["path"]
67
- }
68
- },
69
- {
70
- name: "preview-batch",
71
- description: "\u6279\u91CF\u83B7\u53D6\u591A\u4E2A\u5A92\u4F53\u6587\u4EF6\u7684\u5143\u6570\u636E",
72
- inputSchema: {
73
- type: "object",
74
- properties: {
75
- paths: {
76
- type: "array",
77
- description: "\u5A92\u4F53\u6587\u4EF6\u8DEF\u5F84\u5217\u8868",
78
- items: { type: "string" }
79
- },
80
- rootId: { type: "string", enum: ["workspace"], description: "\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" }
81
- },
82
- required: ["paths"]
83
- }
84
- },
85
- {
86
- name: "preview-batch_get",
87
- description: "\u6279\u91CF\u83B7\u53D6\u5A92\u4F53\u6587\u4EF6\u7684\u9884\u89C8\u80FD\u529B\u3001\u5143\u6570\u636E\u4E0E\u53EF\u9009\u7F29\u7565\u56FE",
88
- inputSchema: {
89
- type: "object",
90
- properties: {
91
- paths: {
92
- type: "array",
93
- description: "\u5A92\u4F53\u6587\u4EF6\u8DEF\u5F84\u5217\u8868",
94
- items: { type: "string" }
95
- },
96
- rootId: { type: "string", enum: ["workspace"], description: "\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" },
97
- includeThumbnail: { type: "boolean", description: "\u662F\u5426\u8FD4\u56DE\u7F29\u7565\u56FE\uFF08\u53EF\u9009\uFF09" },
98
- thumbnailSize: { type: "number", description: "\u7F29\u7565\u56FE\u5C3A\u5BF8\uFF08\u53EF\u9009\uFF09" }
99
- },
100
- required: ["paths"]
101
- }
102
- },
103
- {
104
- name: "preview-extract_text",
105
- description: "\u63D0\u53D6\u5A92\u4F53\u6587\u4EF6\u7684\u63CF\u8FF0\u6027\u5143\u6570\u636E\u6458\u8981\uFF08MIME\u3001\u5C3A\u5BF8\u3001\u65F6\u957F\u7B49\uFF09",
106
- inputSchema: {
107
- type: "object",
108
- properties: {
109
- path: { type: "string", description: "\u5A92\u4F53\u6587\u4EF6\u8DEF\u5F84" },
110
- rootId: { type: "string", enum: ["workspace"], description: "\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" }
111
- },
112
- required: ["path"]
113
- }
114
- },
115
- {
116
- name: "preview-compare_versions",
117
- description: "\u5BF9\u6BD4\u4E24\u4E2A\u5A92\u4F53\u6587\u4EF6\u7248\u672C\u7684\u5143\u6570\u636E\u5DEE\u5F02",
118
- inputSchema: {
119
- type: "object",
120
- properties: {
121
- leftPath: { type: "string", description: "\u5DE6\u4FA7\u6587\u4EF6\u8DEF\u5F84" },
122
- leftRootId: { type: "string", enum: ["workspace"], description: "\u5DE6\u4FA7\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" },
123
- rightPath: { type: "string", description: "\u53F3\u4FA7\u6587\u4EF6\u8DEF\u5F84" },
124
- rightRootId: { type: "string", enum: ["workspace"], description: "\u53F3\u4FA7\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" }
125
- },
126
- required: ["leftPath", "rightPath"]
127
- }
128
- }
129
- ];
130
- var tools = [
131
- ...coreTools,
132
- ...enhancedTools
133
- ];
134
- async function callTool(name, args = {}) {
135
- return getDefaultClient().callTool(name, args);
136
- }
137
- function withRootId(args, rootId) {
138
- return rootId ? { ...args, rootId } : args;
139
- }
140
- var preview = {
141
- get: (path, options) => callTool("preview-get", withRootId({ path }, options?.rootId)),
142
- resolveCapability: (path, options) => callTool("preview-resolve_capability", withRootId({ path }, options?.rootId)),
143
- getMetadata: (path, options) => callTool("preview-get_metadata", withRootId({ path }, options?.rootId)),
144
- getThumbnail: (path, options) => callTool("preview-get_thumbnail", withRootId({ path, width: options?.width, height: options?.height }, options?.rootId)),
145
- file: (path, options) => callTool("preview-file", withRootId({ path }, options?.rootId)),
146
- batch: (paths, options) => callTool("preview-batch", withRootId({ paths }, options?.rootId)),
147
- batchGet: (paths, options) => callTool(
148
- "preview-batch_get",
149
- withRootId({ paths, includeThumbnail: options?.includeThumbnail, thumbnailSize: options?.thumbnailSize }, options?.rootId)
150
- ),
151
- extractText: (path, options) => callTool("preview-extract_text", withRootId({ path }, options?.rootId)),
152
- compareVersions: (leftPath, rightPath, options) => callTool("preview-compare_versions", {
153
- leftPath,
154
- rightPath,
155
- ...options?.leftRootId ? { leftRootId: options.leftRootId } : {},
156
- ...options?.rightRootId ? { rightRootId: options.rightRootId } : {}
157
- })
158
- };
159
-
160
- export { coreTools, enhancedTools, preview, tools };
@@ -1,99 +0,0 @@
1
- import { allTools as allTools$4 } from './chunk-G66KY35N.js';
2
- import { allTools as allTools$2 } from './chunk-4ITOR5QE.js';
3
- import { allTools } from './chunk-XU5GEWWL.js';
4
- import { tools as tools$1 } from './chunk-FLATZQA2.js';
5
- import { allTools as allTools$3 } from './chunk-Z7LV7DCO.js';
6
- import { tools } from './chunk-QD4KISXM.js';
7
- import { allTools as allTools$1 } from './chunk-DSOSHJH2.js';
8
- import { normalizeMCPTool, normalizeMCPToolObjectSchema } from './chunk-ANWOL7SM.js';
9
-
10
- // src/mcp/index.ts
11
- async function loadPlugin(pluginName) {
12
- switch (pluginName) {
13
- case "seastudio":
14
- return import('./mcp/seastudio/index.js');
15
- case "plugin-editor":
16
- case "editor":
17
- return import('./mcp/plugin-editor/index.js');
18
- case "plugin-preview":
19
- case "preview":
20
- return import('./mcp/plugin-preview/index.js');
21
- case "plugin-seaflow":
22
- case "seaflow":
23
- return import('./mcp/plugin-seaflow/index.js');
24
- case "plugin-shell":
25
- case "shell":
26
- return import('./tools-LMW67LIY.js');
27
- case "plugin-excel":
28
- case "excel":
29
- return import('./mcp/plugin-excel/index.js');
30
- case "plugin-word":
31
- case "word":
32
- return import('./mcp/plugin-word/index.js');
33
- default:
34
- throw new Error(`Unknown plugin: ${pluginName}`);
35
- }
36
- }
37
- var MCP_PACKAGES = [
38
- { id: "seastudio", name: "SeaStudio", description: "\u6587\u4EF6/Shell/Git \u57FA\u7840\u80FD\u529B", tools: allTools },
39
- { id: "codeEditor", name: "Code Editor", description: "\u4EE3\u7801\u7F16\u8F91\u5668\u80FD\u529B", tools: allTools$1 },
40
- { id: "preview", name: "Preview", description: "\u9884\u89C8\u5668\u80FD\u529B", tools },
41
- { id: "seaflow", name: "SeaFlow", description: "\u6D41\u7A0B\u753B\u5E03\u6267\u884C\u4E0E\u7F16\u6392\u80FD\u529B", tools: allTools$2 },
42
- { id: "shell", name: "Shell", description: "Shell \u4F1A\u8BDD\u4E0E\u547D\u4EE4\u6267\u884C\u80FD\u529B", tools: tools$1 },
43
- { id: "excel", name: "Excel", description: "Excel \u7535\u5B50\u8868\u683C\u64CD\u4F5C\u80FD\u529B", tools: allTools$3 },
44
- { id: "word", name: "Word", description: "Word \u6587\u6863\u7F16\u8F91\u80FD\u529B", tools: allTools$4 }
45
- ];
46
- function mcpToolToOpenAI(tool) {
47
- const normalizedTool = normalizeMCPTool(tool);
48
- const outputSchema = normalizedTool.outputSchema ? normalizeMCPToolObjectSchema(normalizedTool.outputSchema) : void 0;
49
- return {
50
- type: "function",
51
- ...normalizedTool.annotations ? { annotations: { ...normalizedTool.annotations } } : {},
52
- ...outputSchema ? { outputSchema } : {},
53
- function: {
54
- name: normalizedTool.name,
55
- description: normalizedTool.description,
56
- parameters: normalizeMCPToolObjectSchema(normalizedTool.inputSchema),
57
- ...outputSchema ? { outputSchema } : {}
58
- }
59
- };
60
- }
61
- function listAllTools() {
62
- const tools8 = [];
63
- for (const pkg of MCP_PACKAGES) {
64
- tools8.push(...pkg.tools);
65
- }
66
- return tools8;
67
- }
68
- var listAvailableTools = listAllTools;
69
- var MCP_TOOL_PACKAGE_INDEX = new Map(
70
- MCP_PACKAGES.flatMap((pkg) => pkg.tools.map((tool) => [tool.name, pkg.id]))
71
- );
72
- function getMCPToolPackageIndex() {
73
- return new Map(MCP_TOOL_PACKAGE_INDEX);
74
- }
75
- function getMCPPackageIdForTool(toolName) {
76
- return MCP_TOOL_PACKAGE_INDEX.get(toolName) ?? null;
77
- }
78
- function listAvailableToolsForLLM() {
79
- return listAvailableTools().map(mcpToolToOpenAI);
80
- }
81
- function getMCPPackages() {
82
- return MCP_PACKAGES.map((pkg) => ({
83
- id: pkg.id,
84
- name: pkg.name,
85
- description: pkg.description,
86
- toolCount: pkg.tools.length
87
- }));
88
- }
89
- function getToolsForLLM(disabledPackages) {
90
- const tools8 = [];
91
- for (const pkg of MCP_PACKAGES) {
92
- if (!disabledPackages.has(pkg.id)) {
93
- tools8.push(...pkg.tools.map(mcpToolToOpenAI));
94
- }
95
- }
96
- return tools8;
97
- }
98
-
99
- export { MCP_PACKAGES, getMCPPackageIdForTool, getMCPPackages, getMCPToolPackageIndex, getToolsForLLM, listAllTools, listAvailableTools, listAvailableToolsForLLM, loadPlugin, mcpToolToOpenAI };