@seastudio/sdk 3.0.4 → 3.1.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.
- package/README.md +8 -0
- package/dist/{chunk-GPM5XGYM.js → chunk-4QK6VMIM.js} +743 -821
- package/dist/{chunk-3IVOSJIO.cjs → chunk-7I3A4U6V.cjs} +752 -824
- package/dist/{chunk-PYYG6U4M.cjs → chunk-E33WZ4UI.cjs} +4 -4
- package/dist/{chunk-AXT6ZLY2.js → chunk-IBRD7E5X.js} +2 -2
- package/dist/index.cjs +77 -89
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/mcp/index.cjs +27 -39
- package/dist/mcp/index.d.cts +2 -2
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.js +2 -2
- package/dist/mcp/seastudio/index.cjs +47 -23
- package/dist/mcp/seastudio/index.d.cts +87 -33
- package/dist/mcp/seastudio/index.d.ts +87 -33
- package/dist/mcp/seastudio/index.js +1 -1
- package/package.json +5 -20
- package/bin/seastudio.js +0 -3
- package/dist/develop-tool/cli/index.cjs +0 -1210
- package/dist/develop-tool/cli/index.d.cts +0 -1
- package/dist/develop-tool/cli/index.d.ts +0 -1
- package/dist/develop-tool/cli/index.js +0 -1199
- package/src/develop-tool/templates/plugin/README.md.tmpl +0 -36
- package/src/develop-tool/templates/plugin/frontend/index.html.tmpl +0 -12
- package/src/develop-tool/templates/plugin/frontend/package.json.tmpl +0 -30
- package/src/develop-tool/templates/plugin/frontend/postcss.config.js +0 -6
- package/src/develop-tool/templates/plugin/frontend/src/App.css +0 -43
- package/src/develop-tool/templates/plugin/frontend/src/App.tsx.tmpl +0 -43
- package/src/develop-tool/templates/plugin/frontend/src/main.tsx +0 -13
- package/src/develop-tool/templates/plugin/frontend/src/mcp-entry.ts.tmpl +0 -12
- package/src/develop-tool/templates/plugin/frontend/src/vite-env.d.ts +0 -1
- package/src/develop-tool/templates/plugin/frontend/tsconfig.json +0 -20
- package/src/develop-tool/templates/plugin/frontend/vite.config.ts +0 -12
- package/src/develop-tool/templates/plugin/seastudio.config.json.tmpl +0 -14
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# {{pluginName}}
|
|
2
|
-
|
|
3
|
-
SeaStudio 第三方插件
|
|
4
|
-
|
|
5
|
-
## 开发
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
cd frontend
|
|
9
|
-
npm install
|
|
10
|
-
npm run dev
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## 构建
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
cd frontend
|
|
17
|
-
npm run build
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## 打包
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
seastudio pack
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
打包后会生成 `{{protocolHost}}.seaplugin` 文件。
|
|
27
|
-
|
|
28
|
-
## 安装
|
|
29
|
-
|
|
30
|
-
1. 打开 SeaStudio
|
|
31
|
-
2. 设置 → 插件管理 → 添加插件
|
|
32
|
-
3. 选择 `.seaplugin` 文件
|
|
33
|
-
|
|
34
|
-
## 许可证
|
|
35
|
-
|
|
36
|
-
MIT
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="zh-CN">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>{{pluginName}}</title>
|
|
7
|
-
</head>
|
|
8
|
-
<body>
|
|
9
|
-
<div id="root"></div>
|
|
10
|
-
<script type="module" src="/src/main.tsx"></script>
|
|
11
|
-
</body>
|
|
12
|
-
</html>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "{{pluginId}}-frontend",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "vite",
|
|
8
|
-
"build": "tsc && vite build && npx seastudio generate-mcp-manifest",
|
|
9
|
-
"preview": "vite preview",
|
|
10
|
-
"pack": "cd .. && npx seastudio pack"
|
|
11
|
-
},
|
|
12
|
-
"dependencies": {
|
|
13
|
-
"react": "^19.0.0",
|
|
14
|
-
"react-dom": "^19.0.0",
|
|
15
|
-
"lucide-react": "^0.400.0",
|
|
16
|
-
"@seastudio/sdk": "^3.0.3"
|
|
17
|
-
},
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"@tailwindcss/postcss": "^4.0.0",
|
|
20
|
-
"@tailwindcss/vite": "^4.0.0",
|
|
21
|
-
"@types/react": "^19.0.0",
|
|
22
|
-
"@types/react-dom": "^19.0.0",
|
|
23
|
-
"@vitejs/plugin-react": "^4.3.0",
|
|
24
|
-
"autoprefixer": "^10.4.0",
|
|
25
|
-
"postcss": "^8.5.0",
|
|
26
|
-
"tailwindcss": "^4.0.0",
|
|
27
|
-
"typescript": "^5.4.0",
|
|
28
|
-
"vite": "^6.0.0"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
@import 'tailwindcss';
|
|
2
|
-
|
|
3
|
-
:root {
|
|
4
|
-
--background: 20 14% 4%;
|
|
5
|
-
--foreground: 0 0% 95%;
|
|
6
|
-
--muted: 0 0% 15%;
|
|
7
|
-
--muted-foreground: 0 0% 64%;
|
|
8
|
-
--border: 0 0% 14%;
|
|
9
|
-
--primary: 0 0% 98%;
|
|
10
|
-
--primary-foreground: 0 0% 9%;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
* {
|
|
14
|
-
margin: 0;
|
|
15
|
-
padding: 0;
|
|
16
|
-
box-sizing: border-box;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
body {
|
|
20
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
21
|
-
background-color: hsl(var(--background));
|
|
22
|
-
color: hsl(var(--foreground));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.bg-background {
|
|
26
|
-
background-color: hsl(var(--background));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.text-foreground {
|
|
30
|
-
color: hsl(var(--foreground));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.bg-muted\/50 {
|
|
34
|
-
background-color: hsl(var(--muted) / 0.5);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.text-muted-foreground {
|
|
38
|
-
color: hsl(var(--muted-foreground));
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.border-border {
|
|
42
|
-
border-color: hsl(var(--border));
|
|
43
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
import { callHostTool } from '@seastudio/sdk';
|
|
3
|
-
|
|
4
|
-
function App() {
|
|
5
|
-
const [projectPath, setProjectPath] = useState<string>('');
|
|
6
|
-
const [loading, setLoading] = useState(true);
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
callHostTool('seastudio-project_get_path', {})
|
|
10
|
-
.then((result) => {
|
|
11
|
-
if (result.content?.[0]?.text) {
|
|
12
|
-
const data = JSON.parse(result.content[0].text);
|
|
13
|
-
setProjectPath(data.path || '');
|
|
14
|
-
}
|
|
15
|
-
})
|
|
16
|
-
.catch(console.error)
|
|
17
|
-
.finally(() => setLoading(false));
|
|
18
|
-
}, []);
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<div className="min-h-screen bg-background text-foreground p-6">
|
|
22
|
-
<h1 className="text-2xl font-bold mb-4">{{pluginName}}</h1>
|
|
23
|
-
|
|
24
|
-
<div className="space-y-4">
|
|
25
|
-
<div className="p-4 rounded-lg bg-muted/50 border border-border">
|
|
26
|
-
<h2 className="text-sm font-medium text-muted-foreground mb-2">当前项目</h2>
|
|
27
|
-
<p className="text-sm">
|
|
28
|
-
{loading ? '加载中...' : projectPath || '未打开项目'}
|
|
29
|
-
</p>
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
<div className="p-4 rounded-lg bg-muted/50 border border-border">
|
|
33
|
-
<h2 className="text-sm font-medium text-muted-foreground mb-2">开始开发</h2>
|
|
34
|
-
<p className="text-sm text-muted-foreground">
|
|
35
|
-
编辑此文件 (src/App.tsx) 开始构建你的插件。
|
|
36
|
-
</p>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export default App;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { StrictMode } from 'react';
|
|
2
|
-
import { createRoot } from 'react-dom/client';
|
|
3
|
-
import App from './App';
|
|
4
|
-
import './App.css';
|
|
5
|
-
import { initPluginMCPServer } from './mcp-entry';
|
|
6
|
-
|
|
7
|
-
initPluginMCPServer();
|
|
8
|
-
|
|
9
|
-
createRoot(document.getElementById('root')!).render(
|
|
10
|
-
<StrictMode>
|
|
11
|
-
<App />
|
|
12
|
-
</StrictMode>
|
|
13
|
-
);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { MCPServer, MCPTool, PluginMCPManifest } from '@seastudio/sdk/mcp/core'
|
|
2
|
-
|
|
3
|
-
export const mcpTools: MCPTool[] = []
|
|
4
|
-
|
|
5
|
-
export const pluginMcpManifest: PluginMCPManifest = {
|
|
6
|
-
schemaVersion: 1,
|
|
7
|
-
tools: mcpTools,
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function initPluginMCPServer(_server?: MCPServer): void {
|
|
11
|
-
// 在这里初始化并注册插件自己的 MCP tools handlers。
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2020",
|
|
4
|
-
"useDefineForClassFields": true,
|
|
5
|
-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
6
|
-
"module": "ESNext",
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"moduleResolution": "bundler",
|
|
9
|
-
"allowImportingTsExtensions": true,
|
|
10
|
-
"resolveJsonModule": true,
|
|
11
|
-
"isolatedModules": true,
|
|
12
|
-
"noEmit": true,
|
|
13
|
-
"jsx": "react-jsx",
|
|
14
|
-
"strict": true,
|
|
15
|
-
"noUnusedLocals": true,
|
|
16
|
-
"noUnusedParameters": true,
|
|
17
|
-
"noFallthroughCasesInSwitch": true
|
|
18
|
-
},
|
|
19
|
-
"include": ["src"]
|
|
20
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite';
|
|
2
|
-
import react from '@vitejs/plugin-react';
|
|
3
|
-
import tailwindcss from '@tailwindcss/vite';
|
|
4
|
-
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
plugins: [react(), tailwindcss()],
|
|
7
|
-
base: './',
|
|
8
|
-
build: {
|
|
9
|
-
outDir: 'dist',
|
|
10
|
-
emptyOutDir: true,
|
|
11
|
-
},
|
|
12
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "plugin",
|
|
3
|
-
"id": "{{pluginId}}",
|
|
4
|
-
"name": "{{pluginName}}",
|
|
5
|
-
"version": "1.0.0",
|
|
6
|
-
"category": "{{category}}",
|
|
7
|
-
"protocolHost": "{{protocolHost}}",
|
|
8
|
-
"frontendDir": "frontend",
|
|
9
|
-
"tab": {
|
|
10
|
-
"id": "{{protocolHost}}",
|
|
11
|
-
"title": "{{pluginName}}"
|
|
12
|
-
},
|
|
13
|
-
"mcpTools": []
|
|
14
|
-
}
|