@seastudio/sdk 3.0.0

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 (77) hide show
  1. package/README.md +108 -0
  2. package/bin/seastudio.js +3 -0
  3. package/dist/chunk-4ITOR5QE.js +901 -0
  4. package/dist/chunk-5QAINQWV.js +94 -0
  5. package/dist/chunk-6USQFZRH.js +291 -0
  6. package/dist/chunk-AGBZJGTY.cjs +1311 -0
  7. package/dist/chunk-ANWOL7SM.js +566 -0
  8. package/dist/chunk-BWG45ZWF.cjs +305 -0
  9. package/dist/chunk-CVF4QHS6.cjs +436 -0
  10. package/dist/chunk-DDVRUPMZ.js +1293 -0
  11. package/dist/chunk-DSOSHJH2.js +643 -0
  12. package/dist/chunk-FLATZQA2.js +174 -0
  13. package/dist/chunk-HJJTBVKQ.cjs +909 -0
  14. package/dist/chunk-ISI2OLPI.cjs +179 -0
  15. package/dist/chunk-MYURVLGP.cjs +165 -0
  16. package/dist/chunk-N33Y5NY7.cjs +105 -0
  17. package/dist/chunk-QD4KISXM.js +160 -0
  18. package/dist/chunk-SNGU4SHO.cjs +654 -0
  19. package/dist/chunk-TFOJLA2F.cjs +588 -0
  20. package/dist/chunk-Z7LV7DCO.js +429 -0
  21. package/dist/develop-tool/cli/index.cjs +1138 -0
  22. package/dist/develop-tool/cli/index.d.cts +1 -0
  23. package/dist/develop-tool/cli/index.d.ts +1 -0
  24. package/dist/develop-tool/cli/index.js +1127 -0
  25. package/dist/index.cjs +370 -0
  26. package/dist/index.d.cts +11 -0
  27. package/dist/index.d.ts +11 -0
  28. package/dist/index.js +9 -0
  29. package/dist/mcp/core/index.cjs +90 -0
  30. package/dist/mcp/core/index.d.cts +124 -0
  31. package/dist/mcp/core/index.d.ts +124 -0
  32. package/dist/mcp/core/index.js +1 -0
  33. package/dist/mcp/index.cjs +317 -0
  34. package/dist/mcp/index.d.cts +123 -0
  35. package/dist/mcp/index.d.ts +123 -0
  36. package/dist/mcp/index.js +8 -0
  37. package/dist/mcp/plugin-editor/index.cjs +47 -0
  38. package/dist/mcp/plugin-editor/index.d.cts +98 -0
  39. package/dist/mcp/plugin-editor/index.d.ts +98 -0
  40. package/dist/mcp/plugin-editor/index.js +2 -0
  41. package/dist/mcp/plugin-excel/index.cjs +31 -0
  42. package/dist/mcp/plugin-excel/index.d.cts +86 -0
  43. package/dist/mcp/plugin-excel/index.d.ts +86 -0
  44. package/dist/mcp/plugin-excel/index.js +2 -0
  45. package/dist/mcp/plugin-preview/index.cjs +23 -0
  46. package/dist/mcp/plugin-preview/index.d.cts +109 -0
  47. package/dist/mcp/plugin-preview/index.d.ts +109 -0
  48. package/dist/mcp/plugin-preview/index.js +2 -0
  49. package/dist/mcp/plugin-seaflow/index.cjs +35 -0
  50. package/dist/mcp/plugin-seaflow/index.d.cts +318 -0
  51. package/dist/mcp/plugin-seaflow/index.d.ts +318 -0
  52. package/dist/mcp/plugin-seaflow/index.js +2 -0
  53. package/dist/mcp/seastudio/index.cjs +75 -0
  54. package/dist/mcp/seastudio/index.d.cts +341 -0
  55. package/dist/mcp/seastudio/index.d.ts +341 -0
  56. package/dist/mcp/seastudio/index.js +2 -0
  57. package/dist/tools-LMW67LIY.js +2 -0
  58. package/dist/tools-TU7PBMDO.cjs +23 -0
  59. package/dist/types-Clgf5gBf.d.cts +107 -0
  60. package/dist/types-Clgf5gBf.d.ts +107 -0
  61. package/dist/ui/index.cjs +58 -0
  62. package/dist/ui/index.d.cts +142 -0
  63. package/dist/ui/index.d.ts +142 -0
  64. package/dist/ui/index.js +1 -0
  65. package/package.json +115 -0
  66. package/src/develop-tool/templates/plugin/README.md.tmpl +36 -0
  67. package/src/develop-tool/templates/plugin/frontend/index.html.tmpl +12 -0
  68. package/src/develop-tool/templates/plugin/frontend/package.json.tmpl +30 -0
  69. package/src/develop-tool/templates/plugin/frontend/postcss.config.js +6 -0
  70. package/src/develop-tool/templates/plugin/frontend/src/App.css +43 -0
  71. package/src/develop-tool/templates/plugin/frontend/src/App.tsx.tmpl +43 -0
  72. package/src/develop-tool/templates/plugin/frontend/src/main.tsx +10 -0
  73. package/src/develop-tool/templates/plugin/frontend/src/vite-env.d.ts +1 -0
  74. package/src/develop-tool/templates/plugin/frontend/tsconfig.json +20 -0
  75. package/src/develop-tool/templates/plugin/frontend/vite.config.ts +12 -0
  76. package/src/develop-tool/templates/plugin/seastudio.config.json.tmpl +14 -0
  77. package/src/ui/cosmos.css +407 -0
@@ -0,0 +1,179 @@
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;
@@ -0,0 +1,165 @@
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;
@@ -0,0 +1,105 @@
1
+ 'use strict';
2
+
3
+ var chunkCVF4QHS6_cjs = require('./chunk-CVF4QHS6.cjs');
4
+ var chunkAGBZJGTY_cjs = require('./chunk-AGBZJGTY.cjs');
5
+ var chunkISI2OLPI_cjs = require('./chunk-ISI2OLPI.cjs');
6
+ var chunkSNGU4SHO_cjs = require('./chunk-SNGU4SHO.cjs');
7
+ var chunkMYURVLGP_cjs = require('./chunk-MYURVLGP.cjs');
8
+ var chunkHJJTBVKQ_cjs = require('./chunk-HJJTBVKQ.cjs');
9
+ var chunkTFOJLA2F_cjs = require('./chunk-TFOJLA2F.cjs');
10
+
11
+ // src/mcp/index.ts
12
+ async function loadPlugin(pluginName) {
13
+ switch (pluginName) {
14
+ case "seastudio":
15
+ return import('./mcp/seastudio/index.cjs');
16
+ case "plugin-editor":
17
+ case "editor":
18
+ return import('./mcp/plugin-editor/index.cjs');
19
+ case "plugin-preview":
20
+ case "preview":
21
+ return import('./mcp/plugin-preview/index.cjs');
22
+ case "plugin-seaflow":
23
+ case "seaflow":
24
+ return import('./mcp/plugin-seaflow/index.cjs');
25
+ case "plugin-shell":
26
+ case "shell":
27
+ return import('./tools-TU7PBMDO.cjs');
28
+ case "plugin-excel":
29
+ case "excel":
30
+ return import('./mcp/plugin-excel/index.cjs');
31
+ default:
32
+ throw new Error(`Unknown plugin: ${pluginName}`);
33
+ }
34
+ }
35
+ var MCP_PACKAGES = [
36
+ { id: "seastudio", name: "SeaStudio", description: "\u6587\u4EF6/Shell/Git \u57FA\u7840\u80FD\u529B", tools: chunkAGBZJGTY_cjs.allTools },
37
+ { id: "codeEditor", name: "Code Editor", description: "\u4EE3\u7801\u7F16\u8F91\u5668\u80FD\u529B", tools: chunkSNGU4SHO_cjs.allTools },
38
+ { id: "preview", name: "Preview", description: "\u9884\u89C8\u5668\u80FD\u529B", tools: chunkMYURVLGP_cjs.tools },
39
+ { id: "seaflow", name: "SeaFlow", description: "\u6D41\u7A0B\u753B\u5E03\u6267\u884C\u4E0E\u7F16\u6392\u80FD\u529B", tools: chunkHJJTBVKQ_cjs.allTools },
40
+ { id: "shell", name: "Shell", description: "Shell \u4F1A\u8BDD\u4E0E\u547D\u4EE4\u6267\u884C\u80FD\u529B", tools: chunkISI2OLPI_cjs.tools },
41
+ { id: "excel", name: "Excel", description: "Excel \u7535\u5B50\u8868\u683C\u64CD\u4F5C\u80FD\u529B", tools: chunkCVF4QHS6_cjs.allTools }
42
+ ];
43
+ function mcpToolToOpenAI(tool) {
44
+ const normalizedTool = chunkTFOJLA2F_cjs.normalizeMCPTool(tool);
45
+ const outputSchema = normalizedTool.outputSchema ? chunkTFOJLA2F_cjs.normalizeMCPToolObjectSchema(normalizedTool.outputSchema) : void 0;
46
+ return {
47
+ type: "function",
48
+ ...normalizedTool.annotations ? { annotations: { ...normalizedTool.annotations } } : {},
49
+ ...outputSchema ? { outputSchema } : {},
50
+ function: {
51
+ name: normalizedTool.name,
52
+ description: normalizedTool.description,
53
+ parameters: chunkTFOJLA2F_cjs.normalizeMCPToolObjectSchema(normalizedTool.inputSchema),
54
+ ...outputSchema ? { outputSchema } : {}
55
+ }
56
+ };
57
+ }
58
+ function listAllTools() {
59
+ const tools7 = [];
60
+ for (const pkg of MCP_PACKAGES) {
61
+ tools7.push(...pkg.tools);
62
+ }
63
+ return tools7;
64
+ }
65
+ var listAvailableTools = listAllTools;
66
+ var MCP_TOOL_PACKAGE_INDEX = new Map(
67
+ MCP_PACKAGES.flatMap((pkg) => pkg.tools.map((tool) => [tool.name, pkg.id]))
68
+ );
69
+ function getMCPToolPackageIndex() {
70
+ return new Map(MCP_TOOL_PACKAGE_INDEX);
71
+ }
72
+ function getMCPPackageIdForTool(toolName) {
73
+ return MCP_TOOL_PACKAGE_INDEX.get(toolName) ?? null;
74
+ }
75
+ function listAvailableToolsForLLM() {
76
+ return listAvailableTools().map(mcpToolToOpenAI);
77
+ }
78
+ function getMCPPackages() {
79
+ return MCP_PACKAGES.map((pkg) => ({
80
+ id: pkg.id,
81
+ name: pkg.name,
82
+ description: pkg.description,
83
+ toolCount: pkg.tools.length
84
+ }));
85
+ }
86
+ function getToolsForLLM(disabledPackages) {
87
+ const tools7 = [];
88
+ for (const pkg of MCP_PACKAGES) {
89
+ if (!disabledPackages.has(pkg.id)) {
90
+ tools7.push(...pkg.tools.map(mcpToolToOpenAI));
91
+ }
92
+ }
93
+ return tools7;
94
+ }
95
+
96
+ exports.MCP_PACKAGES = MCP_PACKAGES;
97
+ exports.getMCPPackageIdForTool = getMCPPackageIdForTool;
98
+ exports.getMCPPackages = getMCPPackages;
99
+ exports.getMCPToolPackageIndex = getMCPToolPackageIndex;
100
+ exports.getToolsForLLM = getToolsForLLM;
101
+ exports.listAllTools = listAllTools;
102
+ exports.listAvailableTools = listAvailableTools;
103
+ exports.listAvailableToolsForLLM = listAvailableToolsForLLM;
104
+ exports.loadPlugin = loadPlugin;
105
+ exports.mcpToolToOpenAI = mcpToolToOpenAI;
@@ -0,0 +1,160 @@
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 };