@orion-js/core 3.11.10 → 3.11.11
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.
|
@@ -39,10 +39,10 @@ async function copyCursorRule() {
|
|
|
39
39
|
const content = await downloadFile(sourceUrl);
|
|
40
40
|
// Write the content to the target file
|
|
41
41
|
await promises_1.default.writeFile(targetFile, content, 'utf8');
|
|
42
|
-
console.log(safe_1.default.bold(
|
|
42
|
+
console.log(safe_1.default.bold(`=> ✨ Updated cursor rules to the latest versions`));
|
|
43
43
|
}
|
|
44
44
|
catch (error) {
|
|
45
|
-
console.error('Error copying cursor
|
|
45
|
+
console.error('=> ✨ Error copying cursor rules:', error);
|
|
46
46
|
throw error;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VERSION_FILE = exports.MCP_VERSION = void 0;
|
|
4
4
|
// Define current MCP version - update this when a new version needs to be deployed
|
|
5
|
-
exports.MCP_VERSION = '
|
|
5
|
+
exports.MCP_VERSION = 'v2';
|
|
6
6
|
exports.VERSION_FILE = 'version.txt';
|
|
@@ -18,7 +18,7 @@ async function copyMCP() {
|
|
|
18
18
|
await promises_1.default.mkdir(path_1.default.join(process.cwd(), '.orion'), { recursive: true });
|
|
19
19
|
// Check if the repository is already properly installed with current version
|
|
20
20
|
if (await (0, isValidMCPRepo_1.isValidMCPRepository)(targetDir)) {
|
|
21
|
-
|
|
21
|
+
console.log(safe_1.default.bold(`=> ✨ MCP documentation already installed`));
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
// Check if the directory already exists but is not a valid repository or has outdated version
|
|
@@ -27,23 +27,56 @@ async function copyMCP() {
|
|
|
27
27
|
if (stats.isDirectory()) {
|
|
28
28
|
// Directory exists, remove it first to ensure fresh clone
|
|
29
29
|
await promises_1.default.rm(targetDir, { recursive: true, force: true });
|
|
30
|
-
console.log(safe_1.default.
|
|
30
|
+
console.log(safe_1.default.bold(`=> ✨ Removed existing .orion/mcp directory (invalid, incomplete, or outdated)`));
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
catch (error) {
|
|
34
34
|
// Directory doesn't exist, which is fine
|
|
35
35
|
}
|
|
36
36
|
// Clone the repository
|
|
37
|
-
console.log(safe_1.default.bold(
|
|
37
|
+
console.log(safe_1.default.bold(`=> ✨ Downloading MCP documentation ${consts_1.MCP_VERSION}...`));
|
|
38
38
|
await (0, execute_1.default)(`git clone ${repoUrl} ${targetDir}`);
|
|
39
39
|
// Remove git directory to avoid confusion
|
|
40
40
|
await (0, execute_1.default)(`rm -rf ${path_1.default.join(targetDir, '.git')}`);
|
|
41
41
|
// Create version file
|
|
42
42
|
await promises_1.default.writeFile(path_1.default.join(targetDir, consts_1.VERSION_FILE), consts_1.MCP_VERSION, 'utf-8');
|
|
43
|
-
console.log(safe_1.default.
|
|
43
|
+
console.log(safe_1.default.bold(`=> ✨ Successfully downloaded MCP documentation v${consts_1.MCP_VERSION} to .orion/mcp`));
|
|
44
|
+
const mcpServerConfig = {
|
|
45
|
+
"mcpServers": {
|
|
46
|
+
"orionjs": {
|
|
47
|
+
"command": "node",
|
|
48
|
+
"args": [
|
|
49
|
+
path_1.default.join(targetDir, 'src', 'index.js')
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const configPath = path_1.default.join(process.cwd(), '.cursor', 'mcp.json');
|
|
55
|
+
// Check if the config file exists
|
|
56
|
+
try {
|
|
57
|
+
// Try to read existing config file
|
|
58
|
+
const existingConfig = await promises_1.default.readFile(configPath, 'utf-8');
|
|
59
|
+
const parsedConfig = JSON.parse(existingConfig);
|
|
60
|
+
// Update the mcpServers section while preserving other settings
|
|
61
|
+
parsedConfig.mcpServers = {
|
|
62
|
+
...parsedConfig.mcpServers,
|
|
63
|
+
...mcpServerConfig.mcpServers
|
|
64
|
+
};
|
|
65
|
+
// Write the updated config back
|
|
66
|
+
await promises_1.default.writeFile(configPath, JSON.stringify(parsedConfig, null, 2), 'utf-8');
|
|
67
|
+
console.log(safe_1.default.bold(`=> ✨ Updated MCP server configuration in .cursor/mcp.json`));
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
// If file doesn't exist or can't be parsed, create a new one
|
|
71
|
+
// Ensure the .cursor directory exists
|
|
72
|
+
await promises_1.default.mkdir(path_1.default.dirname(configPath), { recursive: true });
|
|
73
|
+
// Write the new config file
|
|
74
|
+
await promises_1.default.writeFile(configPath, JSON.stringify(mcpServerConfig, null, 2), 'utf-8');
|
|
75
|
+
console.log(safe_1.default.bold(`=> ✨ Created new MCP server configuration in .cursor/mcp.json`));
|
|
76
|
+
}
|
|
44
77
|
}
|
|
45
78
|
catch (error) {
|
|
46
|
-
console.error(safe_1.default.red('Error copying MCP documentation:'), error);
|
|
79
|
+
console.error(safe_1.default.red('=> ✨ Error copying MCP documentation:'), error);
|
|
47
80
|
throw error;
|
|
48
81
|
}
|
|
49
82
|
}
|
|
@@ -20,7 +20,7 @@ async function isValidMCPRepository(directoryPath) {
|
|
|
20
20
|
return false;
|
|
21
21
|
// Check for some key files/directories that should exist in the repository
|
|
22
22
|
// This helps verify it's a valid repository and not just an empty or corrupted directory
|
|
23
|
-
const expectedFiles = ['
|
|
23
|
+
const expectedFiles = ['settings.js', 'package.json'];
|
|
24
24
|
for (const file of expectedFiles) {
|
|
25
25
|
try {
|
|
26
26
|
await promises_1.default.access(path_1.default.join(directoryPath, file));
|
|
@@ -37,7 +37,7 @@ async function isValidMCPRepository(directoryPath) {
|
|
|
37
37
|
// If the version in the file doesn't match the current version,
|
|
38
38
|
// consider the repository outdated
|
|
39
39
|
if (versionContent.trim() !== consts_1.MCP_VERSION) {
|
|
40
|
-
console.log(safe_1.default.yellow(
|
|
40
|
+
console.log(safe_1.default.yellow(`=> ✨ MCP version mismatch: installed=${versionContent.trim()}, required=${consts_1.MCP_VERSION}`));
|
|
41
41
|
return false;
|
|
42
42
|
}
|
|
43
43
|
}
|
package/lib/start/index.js
CHANGED
|
@@ -7,13 +7,17 @@ const safe_1 = __importDefault(require("colors/safe"));
|
|
|
7
7
|
const runner_1 = require("./runner");
|
|
8
8
|
const watchAndCompile_1 = __importDefault(require("./watchAndCompile"));
|
|
9
9
|
const copyCursorRule_1 = require("./copyCursorRule");
|
|
10
|
+
const copyMCP_1 = require("./copyMCP");
|
|
10
11
|
async function default_1(options) {
|
|
11
12
|
console.log(safe_1.default.bold('\nOrionjs App ' + safe_1.default.green(safe_1.default.bold('V3\n'))));
|
|
12
13
|
if (!options.omitCursorRule) {
|
|
13
|
-
(0, copyCursorRule_1.copyCursorRule)().catch(console.error);
|
|
14
|
+
await ((0, copyCursorRule_1.copyCursorRule)().catch(console.error));
|
|
14
15
|
}
|
|
15
16
|
if (!options.omitMcpServer) {
|
|
16
|
-
|
|
17
|
+
await ((0, copyMCP_1.copyMCP)().catch(console.error));
|
|
18
|
+
}
|
|
19
|
+
if (!options.omitMcpServer && !options.omitCursorRule) {
|
|
20
|
+
console.log(safe_1.default.bold(`=> ✨ Orionjs AI is ready\n`));
|
|
17
21
|
}
|
|
18
22
|
const runner = (0, runner_1.getRunner)(options);
|
|
19
23
|
(0, watchAndCompile_1.default)(runner);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orion-js/core",
|
|
3
|
-
"version": "3.11.
|
|
3
|
+
"version": "3.11.11",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"author": "nicolaslopezj",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"engines": {
|
|
37
37
|
"node": ">=14.0.0"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "a1524557edf2cdc5f28ce1f0b52de7ba28b86c3a",
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@shelf/jest-mongodb": "^2.1.0",
|
|
42
42
|
"@types/prompts": "^2.4.2",
|