mirror of
https://github.com/HappyLifeOk/cc-3-8-x-mcp.git
synced 2026-08-21 22:17:08 +00:00
[cc-3-8-x-mcp] 重构: 改为 Gateway 私有 Editor Bridge
改了什么:移除项目级 MCP Server 与 universal-mcp-sdk,新增带随机 token 的本机 Editor Bridge、Gateway v2 注册和分级超时转发。 为什么:MCP 协议与多项目路由统一交给全局 Gateway,项目扩展只保留 Cocos Editor.Message 和离线 CLI 职责。 影响范围:扩展启动与面板、编辑器注册、router 转发、安全边界、使用文档及自动化测试。
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
'use strict';
|
||||
|
||||
var DEV_RELOAD_INFO_KEYS = [
|
||||
'projectPath',
|
||||
'projectName',
|
||||
'editorPid',
|
||||
'editorVersion',
|
||||
'previewUrl',
|
||||
'previewPort',
|
||||
];
|
||||
|
||||
function isSameDevReloadInfo(previous, next) {
|
||||
if (!previous || !next) return false;
|
||||
return DEV_RELOAD_INFO_KEYS.every(function (key) {
|
||||
return previous[key] === next[key];
|
||||
});
|
||||
}
|
||||
|
||||
function isProcessAlive(pid) {
|
||||
var value = Number(pid);
|
||||
if (!Number.isInteger(value) || value <= 0) return false;
|
||||
try {
|
||||
process.kill(value, 0);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return !!(e && e.code === 'EPERM');
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
isSameDevReloadInfo: isSameDevReloadInfo,
|
||||
isProcessAlive: isProcessAlive,
|
||||
};
|
||||
Reference in New Issue
Block a user