@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,174 +0,0 @@
1
- import { getDefaultClient } from './chunk-ANWOL7SM.js';
2
-
3
- // src/mcp/plugin-shell/tools.ts
4
- function annotateTool(tool, annotations, outputSchema) {
5
- return {
6
- ...tool,
7
- annotations,
8
- ...outputSchema ? { outputSchema } : {}
9
- };
10
- }
11
- var shellCommandEvidenceOutputSchema = {
12
- type: "object",
13
- properties: {
14
- command: { type: "string" },
15
- cwd: { type: "string" },
16
- exitCode: { type: "number" },
17
- stdout: { type: "string" },
18
- stderr: { type: "string" },
19
- error: { type: "string" },
20
- durationMs: { type: "number" },
21
- usedFallback: { type: "boolean" }
22
- },
23
- required: ["command", "exitCode", "stdout", "stderr", "durationMs", "usedFallback"]
24
- };
25
- var shellSessionSnapshotEvidenceOutputSchema = {
26
- type: "object",
27
- properties: {
28
- projectPath: { type: "string" },
29
- cwd: { type: "string" },
30
- promptLabel: { type: "string" },
31
- isRunning: { type: "boolean" },
32
- lastExitCode: { type: "number" },
33
- lastDurationMs: { type: "number" },
34
- lastCommandAt: { type: "number" },
35
- historyCount: { type: "number" },
36
- entryCount: { type: "number" }
37
- },
38
- required: ["projectPath", "cwd", "promptLabel", "isRunning", "historyCount", "entryCount"]
39
- };
40
- var sessionTools = [
41
- annotateTool({
42
- name: "shell-get_session",
43
- description: "\u83B7\u53D6\u5F53\u524D Shell \u4F1A\u8BDD\u5FEB\u7167\uFF0C\u5305\u62EC projectPath\u3001cwd\u3001\u8FD0\u884C\u72B6\u6001\u3001\u6700\u8FD1\u4E00\u6B21\u6267\u884C\u7ED3\u679C\u548C prompt \u4FE1\u606F\u3002",
44
- inputSchema: {
45
- type: "object",
46
- properties: {}
47
- }
48
- }, {
49
- operationKind: "read",
50
- requiresExecutionEvidence: false,
51
- rawDomain: "shell"
52
- }, {
53
- type: "object",
54
- properties: {
55
- projectPath: { type: "string" },
56
- cwd: { type: "string" },
57
- promptLabel: { type: "string" },
58
- isRunning: { type: "boolean" },
59
- lastExitCode: { type: "number" },
60
- lastDurationMs: { type: "number" },
61
- lastCommandAt: { type: "number" },
62
- historyCount: { type: "number" },
63
- entryCount: { type: "number" }
64
- }
65
- }),
66
- annotateTool({
67
- name: "shell-get_entries",
68
- description: "\u8BFB\u53D6\u5F53\u524D Shell \u8F93\u51FA\u6D41\uFF0C\u7528\u4E8E\u7406\u89E3\u5386\u53F2\u547D\u4EE4\u3001stdout\u3001stderr \u548C meta \u4FE1\u606F\u3002",
69
- inputSchema: {
70
- type: "object",
71
- properties: {
72
- limit: {
73
- type: "number",
74
- description: "\u53EF\u9009\uFF0C\u8FD4\u56DE\u6700\u8FD1\u591A\u5C11\u6761\u8BB0\u5F55\uFF0C\u9ED8\u8BA4 200\u3002"
75
- }
76
- }
77
- }
78
- }, {
79
- operationKind: "read",
80
- requiresExecutionEvidence: false,
81
- rawDomain: "shell"
82
- }, {
83
- type: "object",
84
- properties: {
85
- entries: {
86
- type: "array",
87
- items: {
88
- type: "object",
89
- properties: {
90
- id: { type: "number" },
91
- level: { type: "string" },
92
- content: { type: "string" },
93
- createdAt: { type: "number" }
94
- }
95
- }
96
- }
97
- }
98
- })
99
- ];
100
- var commandTools = [
101
- annotateTool({
102
- name: "shell-run_command",
103
- description: "\u5728\u5F53\u524D Shell \u4F1A\u8BDD\u4E0A\u4E0B\u6587\u4E2D\u6267\u884C\u547D\u4EE4\u3002\u652F\u6301 cwd / timeout\uFF0C\u547D\u4EE4\u7ED3\u679C\u4F1A\u5199\u5165 Shell \u8F93\u51FA\u6D41\u5E76\u8FD4\u56DE\u6267\u884C\u8BE6\u60C5\u3002",
104
- inputSchema: {
105
- type: "object",
106
- properties: {
107
- command: { type: "string", description: "\u8981\u6267\u884C\u7684\u547D\u4EE4" },
108
- cwd: { type: "string", description: "\u53EF\u9009\uFF0C\u8986\u76D6\u5F53\u524D\u4F1A\u8BDD\u5DE5\u4F5C\u76EE\u5F55" },
109
- timeout: { type: "number", description: "\u53EF\u9009\uFF0C\u8D85\u65F6\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09" }
110
- },
111
- required: ["command"]
112
- }
113
- }, {
114
- operationKind: "system",
115
- requiresExecutionEvidence: true,
116
- rawDomain: "shell"
117
- }, shellCommandEvidenceOutputSchema),
118
- annotateTool({
119
- name: "shell-set_cwd",
120
- description: "\u8BBE\u7F6E\u5F53\u524D Shell \u4F1A\u8BDD\u7684\u5DE5\u4F5C\u76EE\u5F55\uFF0C\u4E0D\u6267\u884C\u547D\u4EE4\u3002\u7528\u4E8E\u663E\u5F0F\u5207\u6362\u4E0A\u4E0B\u6587\u76EE\u5F55\u3002",
121
- inputSchema: {
122
- type: "object",
123
- properties: {
124
- cwd: { type: "string", description: "\u76EE\u6807\u5DE5\u4F5C\u76EE\u5F55" }
125
- },
126
- required: ["cwd"]
127
- }
128
- }, {
129
- operationKind: "mutate",
130
- requiresExecutionEvidence: true,
131
- rawDomain: "shell"
132
- }, shellSessionSnapshotEvidenceOutputSchema),
133
- annotateTool({
134
- name: "shell-clear_output",
135
- description: "\u6E05\u7A7A\u5F53\u524D Shell \u8F93\u51FA\u6D41\uFF0C\u4F46\u4FDD\u7559\u4F1A\u8BDD\u4E0A\u4E0B\u6587\u548C\u547D\u4EE4\u5386\u53F2\u3002",
136
- inputSchema: {
137
- type: "object",
138
- properties: {}
139
- }
140
- }, {
141
- operationKind: "mutate",
142
- requiresExecutionEvidence: true,
143
- rawDomain: "shell"
144
- }, shellSessionSnapshotEvidenceOutputSchema),
145
- annotateTool({
146
- name: "shell-reset_session",
147
- description: "\u91CD\u7F6E\u5F53\u524D Shell \u4F1A\u8BDD\uFF0Ccwd \u56DE\u5230 projectPath\uFF0C\u6E05\u7A7A\u8F93\u51FA\u548C\u6700\u8FD1\u4E00\u6B21\u6267\u884C\u72B6\u6001\u3002",
148
- inputSchema: {
149
- type: "object",
150
- properties: {}
151
- }
152
- }, {
153
- operationKind: "mutate",
154
- requiresExecutionEvidence: true,
155
- rawDomain: "shell"
156
- }, shellSessionSnapshotEvidenceOutputSchema)
157
- ];
158
- var tools = [
159
- ...sessionTools,
160
- ...commandTools
161
- ];
162
- async function callTool(name, args = {}) {
163
- return getDefaultClient().callTool(name, args);
164
- }
165
- var shellPlugin = {
166
- getSession: () => callTool("shell-get_session", {}),
167
- getEntries: (limit) => callTool("shell-get_entries", { limit }),
168
- runCommand: (command, cwd, timeout) => callTool("shell-run_command", { command, cwd, timeout }),
169
- setCwd: (cwd) => callTool("shell-set_cwd", { cwd }),
170
- clearOutput: () => callTool("shell-clear_output", {}),
171
- resetSession: () => callTool("shell-reset_session", {})
172
- };
173
-
174
- export { commandTools, sessionTools, shellPlugin, tools };
@@ -1,334 +0,0 @@
1
- import { getDefaultClient } from './chunk-ANWOL7SM.js';
2
-
3
- // src/mcp/plugin-word/tools.ts
4
- function annotateTool(tool, annotations, outputSchema) {
5
- return {
6
- ...tool,
7
- annotations,
8
- ...{}
9
- };
10
- }
11
- var targetSchema = {
12
- type: "object",
13
- description: "Document target specifier. Use ONE of: blockId, headingText, from/to positions, or omit for current selection / whole document.",
14
- properties: {
15
- blockId: { type: "string", description: "Block-level node ID (returned by get_outline / content_read)" },
16
- blockIndex: { type: "number", description: "0-based top-level block index" },
17
- headingText: { type: "string", description: "Heading text to locate (first match)" },
18
- from: { type: "number", description: "ProseMirror absolute start position (inclusive)" },
19
- to: { type: "number", description: "ProseMirror absolute end position (exclusive)" }
20
- }
21
- };
22
- var inlineStyleSchema = {
23
- type: "object",
24
- description: "Inline formatting marks to apply",
25
- properties: {
26
- bold: { type: "boolean" },
27
- italic: { type: "boolean" },
28
- underline: { type: "boolean" },
29
- strike: { type: "boolean" },
30
- fontSize: { type: "string", description: 'Font size, e.g. "14px" or "12pt"' }
31
- }
32
- };
33
- var blockTypeSchema = {
34
- type: "object",
35
- description: "Block type specification",
36
- properties: {
37
- type: {
38
- type: "string",
39
- enum: ["paragraph", "heading", "bulletList", "orderedList", "blockquote", "codeBlock"],
40
- description: "Target block type"
41
- },
42
- attrs: {
43
- type: "object",
44
- description: 'Block attributes, e.g. { "level": 2 } for heading',
45
- properties: {
46
- level: { type: "number", description: "Heading level 1-6 (only for heading type)" }
47
- }
48
- }
49
- },
50
- required: ["type"]
51
- };
52
- var readTools = [
53
- annotateTool({
54
- name: "word-document_get_context",
55
- 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",
56
- inputSchema: { type: "object", properties: {} }
57
- }, { operationKind: "read", rawDomain: "word" }),
58
- annotateTool({
59
- name: "word-document_get_outline",
60
- 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",
61
- inputSchema: {
62
- type: "object",
63
- properties: {
64
- maxBlocks: { type: "number", description: "\u6700\u5927\u8FD4\u56DE\u5757\u6570\uFF08\u9ED8\u8BA4 200\uFF09" },
65
- offset: { type: "number", description: "\u8DF3\u8FC7\u524D N \u4E2A\u5757\uFF08\u9ED8\u8BA4 0\uFF0C\u7528\u4E8E\u5206\u9875\uFF09" }
66
- }
67
- }
68
- }, { operationKind: "read", rawDomain: "word" }),
69
- annotateTool({
70
- name: "word-selection_get",
71
- 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",
72
- inputSchema: { type: "object", properties: {} }
73
- }, { operationKind: "read", rawDomain: "word" }),
74
- annotateTool({
75
- name: "word-content_read",
76
- 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",
77
- inputSchema: {
78
- type: "object",
79
- properties: {
80
- target: targetSchema,
81
- maxChars: { type: "number", description: "\u6700\u5927\u8FD4\u56DE\u5B57\u7B26\u6570\uFF08\u9ED8\u8BA4 50000\uFF09" },
82
- includeBlockInfo: { type: "boolean", description: "\u662F\u5426\u5305\u542B\u6BCF\u4E2A\u5757\u7684 blockId/blockType \u4FE1\u606F\uFF08\u9ED8\u8BA4 true\uFF09" }
83
- }
84
- }
85
- }, { operationKind: "read", rawDomain: "word" }),
86
- annotateTool({
87
- name: "word-content_export_text",
88
- 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",
89
- inputSchema: {
90
- type: "object",
91
- properties: {
92
- target: targetSchema,
93
- maxChars: { type: "number", description: "\u6700\u5927\u5B57\u7B26\u6570\uFF08\u9ED8\u8BA4 100000\uFF09" }
94
- }
95
- }
96
- }, { operationKind: "read", rawDomain: "word" }),
97
- annotateTool({
98
- name: "word-content_export_markdown",
99
- 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",
100
- inputSchema: {
101
- type: "object",
102
- properties: {
103
- target: targetSchema,
104
- maxChars: { type: "number", description: "\u6700\u5927\u5B57\u7B26\u6570\uFF08\u9ED8\u8BA4 100000\uFF09" }
105
- }
106
- }
107
- }, { operationKind: "read", rawDomain: "word" }),
108
- annotateTool({
109
- name: "word-content_export_html",
110
- 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",
111
- inputSchema: {
112
- type: "object",
113
- properties: {
114
- target: targetSchema,
115
- maxChars: { type: "number", description: "\u6700\u5927\u5B57\u7B26\u6570\uFF08\u9ED8\u8BA4 100000\uFF09" }
116
- }
117
- }
118
- }, { operationKind: "read", rawDomain: "word" }),
119
- annotateTool({
120
- name: "word-find",
121
- 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",
122
- inputSchema: {
123
- type: "object",
124
- properties: {
125
- query: { type: "string", description: "\u641C\u7D22\u5173\u952E\u5B57\u6216\u6B63\u5219\u8868\u8FBE\u5F0F" },
126
- matchCase: { type: "boolean", description: "\u662F\u5426\u533A\u5206\u5927\u5C0F\u5199\uFF08\u9ED8\u8BA4 false\uFF09" },
127
- useRegex: { type: "boolean", description: "\u662F\u5426\u5C06 query \u4F5C\u4E3A\u6B63\u5219\u8868\u8FBE\u5F0F\uFF08\u9ED8\u8BA4 false\uFF09" },
128
- target: targetSchema,
129
- maxResults: { type: "number", description: "\u6700\u5927\u8FD4\u56DE\u6570\u91CF\uFF08\u9ED8\u8BA4 100\uFF09" }
130
- },
131
- required: ["query"]
132
- }
133
- }, { operationKind: "read", rawDomain: "word" }),
134
- annotateTool({
135
- name: "word-styles_list",
136
- 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",
137
- inputSchema: { type: "object", properties: {} }
138
- }, { operationKind: "read", rawDomain: "word" })
139
- ];
140
- var mutateTools = [
141
- annotateTool({
142
- name: "word-selection_set",
143
- 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",
144
- inputSchema: {
145
- type: "object",
146
- properties: { target: targetSchema },
147
- required: ["target"]
148
- }
149
- }, { operationKind: "mutate", rawDomain: "word" }),
150
- annotateTool({
151
- name: "word-content_replace",
152
- 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",
153
- inputSchema: {
154
- type: "object",
155
- properties: {
156
- target: targetSchema,
157
- text: { type: "string", description: "\u66FF\u6362\u4E3A\u7684\u65B0\u6587\u672C\u5185\u5BB9" }
158
- },
159
- required: ["text"]
160
- }
161
- }, { operationKind: "mutate", rawDomain: "word" }),
162
- annotateTool({
163
- name: "word-content_insert_text",
164
- 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",
165
- inputSchema: {
166
- type: "object",
167
- properties: {
168
- text: { type: "string", description: "\u8981\u63D2\u5165\u7684\u6587\u672C\u5185\u5BB9" },
169
- at: { type: "number", description: "ProseMirror \u7EDD\u5BF9\u4F4D\u7F6E" },
170
- afterBlock: { type: "string", description: "\u5728\u6B64 blockId \u4E4B\u540E\u63D2\u5165" },
171
- beforeBlock: { type: "string", description: "\u5728\u6B64 blockId \u4E4B\u524D\u63D2\u5165" },
172
- atEnd: { type: "boolean", description: "\u63D2\u5165\u5230\u6587\u6863\u672B\u5C3E\uFF08\u9ED8\u8BA4 false\uFF09" }
173
- },
174
- required: ["text"]
175
- }
176
- }, { operationKind: "mutate", rawDomain: "word" }),
177
- annotateTool({
178
- name: "word-block_insert",
179
- 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",
180
- inputSchema: {
181
- type: "object",
182
- properties: {
183
- blockType: blockTypeSchema,
184
- content: { type: "string", description: "\u5757\u7684\u6587\u672C\u5185\u5BB9" },
185
- afterBlock: { type: "string", description: "\u5728\u6B64 blockId \u4E4B\u540E\u63D2\u5165" },
186
- beforeBlock: { type: "string", description: "\u5728\u6B64 blockId \u4E4B\u524D\u63D2\u5165" },
187
- atEnd: { type: "boolean", description: "\u8FFD\u52A0\u5230\u6587\u6863\u672B\u5C3E\uFF08\u9ED8\u8BA4 false\uFF09" }
188
- },
189
- required: ["blockType", "content"]
190
- }
191
- }, { operationKind: "mutate", rawDomain: "word" }),
192
- annotateTool({
193
- name: "word-block_delete",
194
- description: "\u5220\u9664\u6307\u5B9A\u7684\u5757\u3002\u652F\u6301\u6309 blockId\u3001blockIndex \u6216 from/to \u8303\u56F4\u5220\u9664\u3002",
195
- inputSchema: {
196
- type: "object",
197
- properties: { target: targetSchema },
198
- required: ["target"]
199
- }
200
- }, { operationKind: "mutate", rawDomain: "word" }),
201
- annotateTool({
202
- name: "word-block_move",
203
- 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",
204
- inputSchema: {
205
- type: "object",
206
- properties: {
207
- sourceBlockId: { type: "string", description: "\u8981\u79FB\u52A8\u7684\u5757 ID" },
208
- sourceBlockIndex: { type: "number", description: "\u8981\u79FB\u52A8\u7684\u5757\u7D22\u5F15\uFF08\u4E0E sourceBlockId \u4E8C\u9009\u4E00\uFF09" },
209
- targetBlockId: { type: "string", description: "\u76EE\u6807\u4F4D\u7F6E\u53C2\u8003\u5757 ID" },
210
- position: { type: "string", enum: ["before", "after"], description: "\u653E\u5728\u76EE\u6807\u5757\u4E4B\u524D\u8FD8\u662F\u4E4B\u540E\uFF08\u9ED8\u8BA4 after\uFF09" }
211
- }
212
- }
213
- }, { operationKind: "mutate", rawDomain: "word" }),
214
- annotateTool({
215
- name: "word-format_apply_inline",
216
- 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",
217
- inputSchema: {
218
- type: "object",
219
- properties: {
220
- target: targetSchema,
221
- style: inlineStyleSchema
222
- },
223
- required: ["style"]
224
- }
225
- }, { operationKind: "mutate", rawDomain: "word" }),
226
- annotateTool({
227
- name: "word-format_set_block",
228
- 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",
229
- inputSchema: {
230
- type: "object",
231
- properties: {
232
- target: targetSchema,
233
- blockType: blockTypeSchema
234
- },
235
- required: ["blockType"]
236
- }
237
- }, { operationKind: "mutate", rawDomain: "word" }),
238
- annotateTool({
239
- name: "word-find_replace",
240
- 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",
241
- inputSchema: {
242
- type: "object",
243
- properties: {
244
- query: { type: "string", description: "\u8981\u67E5\u627E\u7684\u6587\u672C\u6216\u6B63\u5219\u8868\u8FBE\u5F0F" },
245
- replacement: { type: "string", description: "\u66FF\u6362\u4E3A\u7684\u6587\u672C" },
246
- matchCase: { type: "boolean", description: "\u662F\u5426\u533A\u5206\u5927\u5C0F\u5199\uFF08\u9ED8\u8BA4 false\uFF09" },
247
- useRegex: { type: "boolean", description: "\u662F\u5426\u5C06 query \u4F5C\u4E3A\u6B63\u5219\u8868\u8FBE\u5F0F\uFF08\u9ED8\u8BA4 false\uFF09" },
248
- target: targetSchema,
249
- maxReplacements: { type: "number", description: "\u6700\u5927\u66FF\u6362\u6B21\u6570\uFF08\u9ED8\u8BA4 1000\uFF09" }
250
- },
251
- required: ["query", "replacement"]
252
- }
253
- }, { operationKind: "mutate", rawDomain: "word" }),
254
- annotateTool({
255
- name: "word-batch_apply",
256
- 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",
257
- inputSchema: {
258
- type: "object",
259
- properties: {
260
- operations: {
261
- type: "array",
262
- description: "\u64CD\u4F5C\u5217\u8868",
263
- items: {
264
- type: "object",
265
- properties: {
266
- type: {
267
- type: "string",
268
- 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"
269
- },
270
- params: { type: "object", description: "\u64CD\u4F5C\u53C2\u6570\uFF08\u4E0E\u5BF9\u5E94\u5355\u72EC\u5DE5\u5177\u7684 inputSchema \u4E00\u81F4\uFF09", additionalProperties: true }
271
- },
272
- required: ["type", "params"]
273
- }
274
- }
275
- },
276
- required: ["operations"]
277
- }
278
- }, { operationKind: "mutate", rawDomain: "word" })
279
- ];
280
- var lifecycleTools = [
281
- annotateTool({
282
- name: "word-document_open_path",
283
- 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",
284
- inputSchema: {
285
- type: "object",
286
- properties: { path: { type: "string", description: "\u6587\u4EF6\u7EDD\u5BF9\u8DEF\u5F84" } },
287
- required: ["path"]
288
- }
289
- }, { operationKind: "mutate", rawDomain: "word" }),
290
- annotateTool({
291
- name: "word-document_save",
292
- 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",
293
- inputSchema: { type: "object", properties: {} }
294
- }, { operationKind: "mutate", rawDomain: "word" }),
295
- annotateTool({
296
- name: "word-document_reload",
297
- 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",
298
- inputSchema: { type: "object", properties: {} }
299
- }, { operationKind: "mutate", rawDomain: "word" })
300
- ];
301
- var tools = [...readTools, ...mutateTools, ...lifecycleTools];
302
- var allTools = tools;
303
- async function callTool(name, args = {}) {
304
- return getDefaultClient().callTool(name, args);
305
- }
306
- var word = {
307
- // Read
308
- getContext: () => callTool("word-document_get_context"),
309
- getOutline: (opts) => callTool("word-document_get_outline", opts ?? {}),
310
- getSelection: () => callTool("word-selection_get"),
311
- readContent: (opts) => callTool("word-content_read", opts ?? {}),
312
- exportText: (opts) => callTool("word-content_export_text", opts ?? {}),
313
- exportMarkdown: (opts) => callTool("word-content_export_markdown", opts ?? {}),
314
- exportHtml: (opts) => callTool("word-content_export_html", opts ?? {}),
315
- find: (query, opts) => callTool("word-find", { query, ...opts }),
316
- listStyles: () => callTool("word-styles_list"),
317
- // Mutate
318
- setSelection: (target) => callTool("word-selection_set", { target }),
319
- replaceContent: (text, target) => callTool("word-content_replace", { text, ...target ? { target } : {} }),
320
- insertText: (text, opts) => callTool("word-content_insert_text", { text, ...opts }),
321
- insertBlock: (blockType, content, opts) => callTool("word-block_insert", { blockType, content, ...opts }),
322
- deleteBlock: (target) => callTool("word-block_delete", { target }),
323
- moveBlock: (opts) => callTool("word-block_move", opts),
324
- applyInlineFormat: (style, target) => callTool("word-format_apply_inline", { style, ...target ? { target } : {} }),
325
- setBlockType: (blockType, target) => callTool("word-format_set_block", { blockType, ...target ? { target } : {} }),
326
- findReplace: (query, replacement, opts) => callTool("word-find_replace", { query, replacement, ...opts }),
327
- batchApply: (operations) => callTool("word-batch_apply", { operations }),
328
- // Lifecycle
329
- openPath: (path) => callTool("word-document_open_path", { path }),
330
- save: () => callTool("word-document_save"),
331
- reload: () => callTool("word-document_reload")
332
- };
333
-
334
- export { allTools, lifecycleTools, mutateTools, readTools, tools, word };