@seastudio/sdk 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/bin/seastudio.js +0 -0
  2. package/dist/chunk-D7ONFXVY.js +98 -0
  3. package/dist/chunk-EIOFZMTC.cjs +109 -0
  4. package/dist/{chunk-AGBZJGTY.cjs → chunk-SUF5BPSK.cjs} +3 -1
  5. package/dist/{chunk-DDVRUPMZ.js → chunk-XU5GEWWL.js} +3 -1
  6. package/dist/develop-tool/cli/index.cjs +79 -7
  7. package/dist/develop-tool/cli/index.js +79 -7
  8. package/dist/index.cjs +42 -167
  9. package/dist/index.d.cts +2 -6
  10. package/dist/index.d.ts +2 -6
  11. package/dist/index.js +2 -7
  12. package/dist/mcp/core/index.d.cts +2 -2
  13. package/dist/mcp/core/index.d.ts +2 -2
  14. package/dist/mcp/index.cjs +27 -152
  15. package/dist/mcp/index.d.cts +12 -77
  16. package/dist/mcp/index.d.ts +12 -77
  17. package/dist/mcp/index.js +2 -7
  18. package/dist/mcp/seastudio/index.cjs +18 -18
  19. package/dist/mcp/seastudio/index.d.cts +34 -2
  20. package/dist/mcp/seastudio/index.d.ts +34 -2
  21. package/dist/mcp/seastudio/index.js +1 -1
  22. package/dist/{types-Clgf5gBf.d.cts → types-B32sUvc0.d.cts} +10 -2
  23. package/dist/{types-Clgf5gBf.d.ts → types-B32sUvc0.d.ts} +10 -2
  24. package/package.json +2 -22
  25. package/src/develop-tool/templates/plugin/frontend/package.json.tmpl +1 -1
  26. package/src/develop-tool/templates/plugin/frontend/src/main.tsx +3 -0
  27. package/src/develop-tool/templates/plugin/frontend/src/mcp-entry.ts.tmpl +12 -0
  28. package/dist/chunk-4ITOR5QE.js +0 -901
  29. package/dist/chunk-CSXDT47Y.cjs +0 -105
  30. package/dist/chunk-CVF4QHS6.cjs +0 -436
  31. package/dist/chunk-DSOSHJH2.js +0 -643
  32. package/dist/chunk-FLATZQA2.js +0 -174
  33. package/dist/chunk-HJJTBVKQ.cjs +0 -909
  34. package/dist/chunk-ISI2OLPI.cjs +0 -179
  35. package/dist/chunk-MYURVLGP.cjs +0 -165
  36. package/dist/chunk-QD4KISXM.js +0 -160
  37. package/dist/chunk-SNGU4SHO.cjs +0 -654
  38. package/dist/chunk-V7MNKGS7.js +0 -94
  39. package/dist/chunk-Z7LV7DCO.js +0 -429
  40. package/dist/mcp/plugin-editor/index.cjs +0 -47
  41. package/dist/mcp/plugin-editor/index.d.cts +0 -98
  42. package/dist/mcp/plugin-editor/index.d.ts +0 -98
  43. package/dist/mcp/plugin-editor/index.js +0 -2
  44. package/dist/mcp/plugin-excel/index.cjs +0 -31
  45. package/dist/mcp/plugin-excel/index.d.cts +0 -86
  46. package/dist/mcp/plugin-excel/index.d.ts +0 -86
  47. package/dist/mcp/plugin-excel/index.js +0 -2
  48. package/dist/mcp/plugin-preview/index.cjs +0 -23
  49. package/dist/mcp/plugin-preview/index.d.cts +0 -109
  50. package/dist/mcp/plugin-preview/index.d.ts +0 -109
  51. package/dist/mcp/plugin-preview/index.js +0 -2
  52. package/dist/mcp/plugin-seaflow/index.cjs +0 -35
  53. package/dist/mcp/plugin-seaflow/index.d.cts +0 -318
  54. package/dist/mcp/plugin-seaflow/index.d.ts +0 -318
  55. package/dist/mcp/plugin-seaflow/index.js +0 -2
  56. package/dist/tools-LMW67LIY.js +0 -2
  57. package/dist/tools-TU7PBMDO.cjs +0 -23
@@ -1,179 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkTFOJLA2F_cjs = require('./chunk-TFOJLA2F.cjs');
4
-
5
- // src/mcp/plugin-shell/tools.ts
6
- function annotateTool(tool, annotations, outputSchema) {
7
- return {
8
- ...tool,
9
- annotations,
10
- ...outputSchema ? { outputSchema } : {}
11
- };
12
- }
13
- var shellCommandEvidenceOutputSchema = {
14
- type: "object",
15
- properties: {
16
- command: { type: "string" },
17
- cwd: { type: "string" },
18
- exitCode: { type: "number" },
19
- stdout: { type: "string" },
20
- stderr: { type: "string" },
21
- error: { type: "string" },
22
- durationMs: { type: "number" },
23
- usedFallback: { type: "boolean" }
24
- },
25
- required: ["command", "exitCode", "stdout", "stderr", "durationMs", "usedFallback"]
26
- };
27
- var shellSessionSnapshotEvidenceOutputSchema = {
28
- type: "object",
29
- properties: {
30
- projectPath: { type: "string" },
31
- cwd: { type: "string" },
32
- promptLabel: { type: "string" },
33
- isRunning: { type: "boolean" },
34
- lastExitCode: { type: "number" },
35
- lastDurationMs: { type: "number" },
36
- lastCommandAt: { type: "number" },
37
- historyCount: { type: "number" },
38
- entryCount: { type: "number" }
39
- },
40
- required: ["projectPath", "cwd", "promptLabel", "isRunning", "historyCount", "entryCount"]
41
- };
42
- var sessionTools = [
43
- annotateTool({
44
- name: "shell-get_session",
45
- 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",
46
- inputSchema: {
47
- type: "object",
48
- properties: {}
49
- }
50
- }, {
51
- operationKind: "read",
52
- requiresExecutionEvidence: false,
53
- rawDomain: "shell"
54
- }, {
55
- type: "object",
56
- properties: {
57
- projectPath: { type: "string" },
58
- cwd: { type: "string" },
59
- promptLabel: { type: "string" },
60
- isRunning: { type: "boolean" },
61
- lastExitCode: { type: "number" },
62
- lastDurationMs: { type: "number" },
63
- lastCommandAt: { type: "number" },
64
- historyCount: { type: "number" },
65
- entryCount: { type: "number" }
66
- }
67
- }),
68
- annotateTool({
69
- name: "shell-get_entries",
70
- 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",
71
- inputSchema: {
72
- type: "object",
73
- properties: {
74
- limit: {
75
- type: "number",
76
- description: "\u53EF\u9009\uFF0C\u8FD4\u56DE\u6700\u8FD1\u591A\u5C11\u6761\u8BB0\u5F55\uFF0C\u9ED8\u8BA4 200\u3002"
77
- }
78
- }
79
- }
80
- }, {
81
- operationKind: "read",
82
- requiresExecutionEvidence: false,
83
- rawDomain: "shell"
84
- }, {
85
- type: "object",
86
- properties: {
87
- entries: {
88
- type: "array",
89
- items: {
90
- type: "object",
91
- properties: {
92
- id: { type: "number" },
93
- level: { type: "string" },
94
- content: { type: "string" },
95
- createdAt: { type: "number" }
96
- }
97
- }
98
- }
99
- }
100
- })
101
- ];
102
- var commandTools = [
103
- annotateTool({
104
- name: "shell-run_command",
105
- 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",
106
- inputSchema: {
107
- type: "object",
108
- properties: {
109
- command: { type: "string", description: "\u8981\u6267\u884C\u7684\u547D\u4EE4" },
110
- cwd: { type: "string", description: "\u53EF\u9009\uFF0C\u8986\u76D6\u5F53\u524D\u4F1A\u8BDD\u5DE5\u4F5C\u76EE\u5F55" },
111
- timeout: { type: "number", description: "\u53EF\u9009\uFF0C\u8D85\u65F6\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09" }
112
- },
113
- required: ["command"]
114
- }
115
- }, {
116
- operationKind: "system",
117
- requiresExecutionEvidence: true,
118
- rawDomain: "shell"
119
- }, shellCommandEvidenceOutputSchema),
120
- annotateTool({
121
- name: "shell-set_cwd",
122
- 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",
123
- inputSchema: {
124
- type: "object",
125
- properties: {
126
- cwd: { type: "string", description: "\u76EE\u6807\u5DE5\u4F5C\u76EE\u5F55" }
127
- },
128
- required: ["cwd"]
129
- }
130
- }, {
131
- operationKind: "mutate",
132
- requiresExecutionEvidence: true,
133
- rawDomain: "shell"
134
- }, shellSessionSnapshotEvidenceOutputSchema),
135
- annotateTool({
136
- name: "shell-clear_output",
137
- description: "\u6E05\u7A7A\u5F53\u524D Shell \u8F93\u51FA\u6D41\uFF0C\u4F46\u4FDD\u7559\u4F1A\u8BDD\u4E0A\u4E0B\u6587\u548C\u547D\u4EE4\u5386\u53F2\u3002",
138
- inputSchema: {
139
- type: "object",
140
- properties: {}
141
- }
142
- }, {
143
- operationKind: "mutate",
144
- requiresExecutionEvidence: true,
145
- rawDomain: "shell"
146
- }, shellSessionSnapshotEvidenceOutputSchema),
147
- annotateTool({
148
- name: "shell-reset_session",
149
- 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",
150
- inputSchema: {
151
- type: "object",
152
- properties: {}
153
- }
154
- }, {
155
- operationKind: "mutate",
156
- requiresExecutionEvidence: true,
157
- rawDomain: "shell"
158
- }, shellSessionSnapshotEvidenceOutputSchema)
159
- ];
160
- var tools = [
161
- ...sessionTools,
162
- ...commandTools
163
- ];
164
- async function callTool(name, args = {}) {
165
- return chunkTFOJLA2F_cjs.getDefaultClient().callTool(name, args);
166
- }
167
- var shellPlugin = {
168
- getSession: () => callTool("shell-get_session", {}),
169
- getEntries: (limit) => callTool("shell-get_entries", { limit }),
170
- runCommand: (command, cwd, timeout) => callTool("shell-run_command", { command, cwd, timeout }),
171
- setCwd: (cwd) => callTool("shell-set_cwd", { cwd }),
172
- clearOutput: () => callTool("shell-clear_output", {}),
173
- resetSession: () => callTool("shell-reset_session", {})
174
- };
175
-
176
- exports.commandTools = commandTools;
177
- exports.sessionTools = sessionTools;
178
- exports.shellPlugin = shellPlugin;
179
- exports.tools = tools;
@@ -1,165 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkTFOJLA2F_cjs = require('./chunk-TFOJLA2F.cjs');
4
-
5
- // src/mcp/plugin-preview/tools.ts
6
- var coreTools = [
7
- {
8
- name: "preview-get",
9
- 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",
10
- inputSchema: {
11
- type: "object",
12
- properties: {
13
- path: { type: "string", description: "\u5A92\u4F53\u6587\u4EF6\u8DEF\u5F84\uFF08\u56FE\u7247/\u89C6\u9891/\u97F3\u9891\uFF09" },
14
- rootId: { type: "string", enum: ["workspace"], description: "\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" }
15
- },
16
- required: ["path"]
17
- }
18
- },
19
- {
20
- name: "preview-resolve_capability",
21
- 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",
22
- inputSchema: {
23
- type: "object",
24
- properties: {
25
- path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84" },
26
- rootId: { type: "string", enum: ["workspace"], description: "\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" }
27
- },
28
- required: ["path"]
29
- }
30
- },
31
- {
32
- name: "preview-get_metadata",
33
- description: "\u83B7\u53D6\u5A92\u4F53\u6587\u4EF6\u7684\u5143\u6570\u636E\uFF08MIME \u7C7B\u578B\u3001\u5927\u5C0F\u3001\u6269\u5C55\u540D\u7B49\uFF09",
34
- inputSchema: {
35
- type: "object",
36
- properties: {
37
- path: { type: "string", description: "\u6587\u4EF6\u8DEF\u5F84" },
38
- rootId: { type: "string", enum: ["workspace"], description: "\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" }
39
- },
40
- required: ["path"]
41
- }
42
- },
43
- {
44
- name: "preview-get_thumbnail",
45
- description: "\u83B7\u53D6\u56FE\u7247\u6587\u4EF6\u7684\u7F29\u7565\u56FE URL\u3002\u4EC5\u5BF9\u56FE\u7247\u7C7B\u578B\u6709\u6548\u3002",
46
- inputSchema: {
47
- type: "object",
48
- properties: {
49
- path: { type: "string", description: "\u56FE\u7247\u6587\u4EF6\u8DEF\u5F84" },
50
- rootId: { type: "string", enum: ["workspace"], description: "\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" },
51
- width: { type: "number", description: "\u7F29\u7565\u56FE\u5BBD\u5EA6\uFF08\u53EF\u9009\uFF09" },
52
- height: { type: "number", description: "\u7F29\u7565\u56FE\u9AD8\u5EA6\uFF08\u53EF\u9009\uFF09" }
53
- },
54
- required: ["path"]
55
- }
56
- }
57
- ];
58
- var enhancedTools = [
59
- {
60
- name: "preview-file",
61
- 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",
62
- inputSchema: {
63
- type: "object",
64
- properties: {
65
- path: { type: "string", description: "\u5A92\u4F53\u6587\u4EF6\u8DEF\u5F84" },
66
- rootId: { type: "string", enum: ["workspace"], description: "\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" }
67
- },
68
- required: ["path"]
69
- }
70
- },
71
- {
72
- name: "preview-batch",
73
- description: "\u6279\u91CF\u83B7\u53D6\u591A\u4E2A\u5A92\u4F53\u6587\u4EF6\u7684\u5143\u6570\u636E",
74
- inputSchema: {
75
- type: "object",
76
- properties: {
77
- paths: {
78
- type: "array",
79
- description: "\u5A92\u4F53\u6587\u4EF6\u8DEF\u5F84\u5217\u8868",
80
- items: { type: "string" }
81
- },
82
- rootId: { type: "string", enum: ["workspace"], description: "\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" }
83
- },
84
- required: ["paths"]
85
- }
86
- },
87
- {
88
- name: "preview-batch_get",
89
- description: "\u6279\u91CF\u83B7\u53D6\u5A92\u4F53\u6587\u4EF6\u7684\u9884\u89C8\u80FD\u529B\u3001\u5143\u6570\u636E\u4E0E\u53EF\u9009\u7F29\u7565\u56FE",
90
- inputSchema: {
91
- type: "object",
92
- properties: {
93
- paths: {
94
- type: "array",
95
- description: "\u5A92\u4F53\u6587\u4EF6\u8DEF\u5F84\u5217\u8868",
96
- items: { type: "string" }
97
- },
98
- rootId: { type: "string", enum: ["workspace"], description: "\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" },
99
- includeThumbnail: { type: "boolean", description: "\u662F\u5426\u8FD4\u56DE\u7F29\u7565\u56FE\uFF08\u53EF\u9009\uFF09" },
100
- thumbnailSize: { type: "number", description: "\u7F29\u7565\u56FE\u5C3A\u5BF8\uFF08\u53EF\u9009\uFF09" }
101
- },
102
- required: ["paths"]
103
- }
104
- },
105
- {
106
- name: "preview-extract_text",
107
- 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",
108
- inputSchema: {
109
- type: "object",
110
- properties: {
111
- path: { type: "string", description: "\u5A92\u4F53\u6587\u4EF6\u8DEF\u5F84" },
112
- rootId: { type: "string", enum: ["workspace"], description: "\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" }
113
- },
114
- required: ["path"]
115
- }
116
- },
117
- {
118
- name: "preview-compare_versions",
119
- description: "\u5BF9\u6BD4\u4E24\u4E2A\u5A92\u4F53\u6587\u4EF6\u7248\u672C\u7684\u5143\u6570\u636E\u5DEE\u5F02",
120
- inputSchema: {
121
- type: "object",
122
- properties: {
123
- leftPath: { type: "string", description: "\u5DE6\u4FA7\u6587\u4EF6\u8DEF\u5F84" },
124
- leftRootId: { type: "string", enum: ["workspace"], description: "\u5DE6\u4FA7\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" },
125
- rightPath: { type: "string", description: "\u53F3\u4FA7\u6587\u4EF6\u8DEF\u5F84" },
126
- rightRootId: { type: "string", enum: ["workspace"], description: "\u53F3\u4FA7\u6587\u4EF6\u6839\uFF08\u9ED8\u8BA4 workspace\uFF09" }
127
- },
128
- required: ["leftPath", "rightPath"]
129
- }
130
- }
131
- ];
132
- var tools = [
133
- ...coreTools,
134
- ...enhancedTools
135
- ];
136
- async function callTool(name, args = {}) {
137
- return chunkTFOJLA2F_cjs.getDefaultClient().callTool(name, args);
138
- }
139
- function withRootId(args, rootId) {
140
- return rootId ? { ...args, rootId } : args;
141
- }
142
- var preview = {
143
- get: (path, options) => callTool("preview-get", withRootId({ path }, options?.rootId)),
144
- resolveCapability: (path, options) => callTool("preview-resolve_capability", withRootId({ path }, options?.rootId)),
145
- getMetadata: (path, options) => callTool("preview-get_metadata", withRootId({ path }, options?.rootId)),
146
- getThumbnail: (path, options) => callTool("preview-get_thumbnail", withRootId({ path, width: options?.width, height: options?.height }, options?.rootId)),
147
- file: (path, options) => callTool("preview-file", withRootId({ path }, options?.rootId)),
148
- batch: (paths, options) => callTool("preview-batch", withRootId({ paths }, options?.rootId)),
149
- batchGet: (paths, options) => callTool(
150
- "preview-batch_get",
151
- withRootId({ paths, includeThumbnail: options?.includeThumbnail, thumbnailSize: options?.thumbnailSize }, options?.rootId)
152
- ),
153
- extractText: (path, options) => callTool("preview-extract_text", withRootId({ path }, options?.rootId)),
154
- compareVersions: (leftPath, rightPath, options) => callTool("preview-compare_versions", {
155
- leftPath,
156
- rightPath,
157
- ...options?.leftRootId ? { leftRootId: options.leftRootId } : {},
158
- ...options?.rightRootId ? { rightRootId: options.rightRootId } : {}
159
- })
160
- };
161
-
162
- exports.coreTools = coreTools;
163
- exports.enhancedTools = enhancedTools;
164
- exports.preview = preview;
165
- exports.tools = tools;
@@ -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 };