Merge branch 'main' of https://github.com/LSTM-Kirigaya/openmcp-client
This commit is contained in:
commit
a8cde189e5
9490
package-lock.json
generated
9490
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
88
package.json
88
package.json
@ -1,58 +1,36 @@
|
||||
{
|
||||
"name": "openmcp",
|
||||
"displayName": "openmcp",
|
||||
"description": "A MCP Client for MCP/OpenMCP",
|
||||
"version": "0.0.1",
|
||||
"engines": {
|
||||
"vscode": "^1.98.0"
|
||||
},
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"activationEvents": [
|
||||
"*"
|
||||
],
|
||||
"main": "./dist/extension.js",
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
"command": "openmcp.helloWorld",
|
||||
"title": "Hello World"
|
||||
}
|
||||
],
|
||||
"views": {
|
||||
"explorer": [
|
||||
{
|
||||
"id": "webview-sidebar.view",
|
||||
"icon": "./icons/protocol.svg",
|
||||
"name": "WebView"
|
||||
"name": "openmcp",
|
||||
"displayName": "openmcp",
|
||||
"description": "A MCP Client for MCP/OpenMCP",
|
||||
"version": "0.0.1",
|
||||
"engines": {
|
||||
"vscode": "^1.98.0"
|
||||
},
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"activationEvents": [
|
||||
],
|
||||
"main": "./dist/extension.js",
|
||||
"contributes": {
|
||||
"viewsContainers": {
|
||||
"activitybar": [
|
||||
{
|
||||
"id": "openmcp-sidebar",
|
||||
"title": "OpenMCP",
|
||||
"icon": "./icons/protocol.svg"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"vscode:prepublish": "npm run package",
|
||||
"compile": "webpack",
|
||||
"watch": "webpack --watch",
|
||||
"package": "webpack --mode production --devtool hidden-source-map",
|
||||
"compile-tests": "tsc -p . --outDir out",
|
||||
"watch-tests": "tsc -p . -w --outDir out",
|
||||
"pretest": "npm run compile-tests && npm run compile && npm run lint",
|
||||
"lint": "eslint src",
|
||||
"test": "vscode-test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/vscode": "^1.98.0",
|
||||
"@types/mocha": "^10.0.10",
|
||||
"@types/node": "20.x",
|
||||
"@typescript-eslint/eslint-plugin": "^8.25.0",
|
||||
"@typescript-eslint/parser": "^8.25.0",
|
||||
"eslint": "^9.21.0",
|
||||
"typescript": "^5.7.3",
|
||||
"ts-loader": "^9.5.2",
|
||||
"webpack": "^5.98.0",
|
||||
"webpack-cli": "^6.0.1",
|
||||
"@vscode/test-cli": "^0.0.10",
|
||||
"@vscode/test-electron": "^2.4.1"
|
||||
}
|
||||
]
|
||||
},
|
||||
"views": {
|
||||
"openmcp-sidebar": [
|
||||
{
|
||||
"id": "webview-sidebar.view",
|
||||
"icon": "./icons/protocol.svg",
|
||||
"name": "chatbot",
|
||||
"type": "webview"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
@ -1,16 +1,9 @@
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
export function activate(context: vscode.ExtensionContext) {
|
||||
// 注册 WebView 视图
|
||||
console.log('activate');
|
||||
|
||||
const provider = new WebviewViewProvider(context.extensionUri);
|
||||
console.log('activate openmcp'); // 确保插件已激活
|
||||
|
||||
context.subscriptions.push(
|
||||
vscode.commands.registerCommand('openmcp.helloWorld', () => {
|
||||
vscode.window.showInformationMessage('Hello World!');
|
||||
})
|
||||
)
|
||||
const provider = new WebviewViewProvider(context.extensionUri);
|
||||
|
||||
context.subscriptions.push(
|
||||
vscode.window.registerWebviewViewProvider('webview-sidebar.view', provider)
|
||||
@ -20,13 +13,19 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
class WebviewViewProvider implements vscode.WebviewViewProvider {
|
||||
constructor(private readonly _extensionUri: vscode.Uri) {}
|
||||
|
||||
public resolveWebviewView(webviewView: vscode.WebviewView) {
|
||||
public resolveWebviewView(
|
||||
webviewView: vscode.WebviewView,
|
||||
_context: vscode.WebviewViewResolveContext,
|
||||
_token: vscode.CancellationToken,
|
||||
) {
|
||||
console.log('resolveWebviewView called'); // 确保方法被调用
|
||||
webviewView.webview.options = {
|
||||
enableScripts: true, // 启用 JavaScript
|
||||
enableScripts: true,
|
||||
};
|
||||
|
||||
// 设置 WebView 的 HTML 内容
|
||||
webviewView.webview.html = getWebviewContent();
|
||||
const html = getWebviewContent();
|
||||
console.log('WebView HTML:', html); // 检查 HTML 内容
|
||||
webviewView.webview.html = html;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user