@codesys/mcp-toolkit 1.1.5 → 1.1.6
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/.claude/settings.local.json +2 -5
- package/CHANGELOG.md +3 -5
- package/dist/bin.js +2 -41
- package/dist/server.js +319 -503
- package/package.json +3 -3
- package/codesys_scripts/listener_script.py +0 -1539
package/CHANGELOG.md
CHANGED
|
@@ -5,14 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [1.1.
|
|
8
|
+
## [1.1.6] - 2025-05-06
|
|
9
9
|
|
|
10
10
|
### Fixed
|
|
11
|
-
-
|
|
12
|
-
- Enhanced path resolution to better handle "Application" paths in both new and existing projects
|
|
13
|
-
- Fixed TypeScript build error by updating McpServer method from start() to connect()
|
|
11
|
+
- Added TypeScript as dev dependency to fix build process
|
|
14
12
|
|
|
15
|
-
## [1.1.4] - 2025-
|
|
13
|
+
## [1.1.4] - 2025-05-01
|
|
16
14
|
|
|
17
15
|
### Changed
|
|
18
16
|
- Refactored the code for better maintainability
|
package/dist/bin.js
CHANGED
|
@@ -8,45 +8,11 @@
|
|
|
8
8
|
* This is the entry point for the MCP toolkit when invoked as a command-line tool.
|
|
9
9
|
* It handles argument parsing and passes configuration to server.ts via function parameters.
|
|
10
10
|
*/
|
|
11
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
-
if (k2 === undefined) k2 = k;
|
|
13
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
16
|
-
}
|
|
17
|
-
Object.defineProperty(o, k2, desc);
|
|
18
|
-
}) : (function(o, m, k, k2) {
|
|
19
|
-
if (k2 === undefined) k2 = k;
|
|
20
|
-
o[k2] = m[k];
|
|
21
|
-
}));
|
|
22
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
23
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
24
|
-
}) : function(o, v) {
|
|
25
|
-
o["default"] = v;
|
|
26
|
-
});
|
|
27
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
28
|
-
var ownKeys = function(o) {
|
|
29
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
30
|
-
var ar = [];
|
|
31
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
32
|
-
return ar;
|
|
33
|
-
};
|
|
34
|
-
return ownKeys(o);
|
|
35
|
-
};
|
|
36
|
-
return function (mod) {
|
|
37
|
-
if (mod && mod.__esModule) return mod;
|
|
38
|
-
var result = {};
|
|
39
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
-
__setModuleDefault(result, mod);
|
|
41
|
-
return result;
|
|
42
|
-
};
|
|
43
|
-
})();
|
|
44
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
12
|
// Use Commander for initial parsing
|
|
46
13
|
const commander_1 = require("commander");
|
|
47
14
|
// Import the server setup function
|
|
48
15
|
const server_js_1 = require("./server.js"); // Adjust path if needed
|
|
49
|
-
const path = __importStar(require("path")); // Import path module
|
|
50
16
|
console.error(">>> BIN.TS Starting <<<");
|
|
51
17
|
// Define version from package.json
|
|
52
18
|
// Use import assertion for JSON in ES modules if possible, otherwise require is okay for CommonJS
|
|
@@ -69,12 +35,9 @@ commander_1.program
|
|
|
69
35
|
.option('-f, --codesys-profile <profile>', // Changed alias to 'f' to avoid conflict if you add other '-p' options
|
|
70
36
|
'CODESYS profile name (overrides CODESYS_PROFILE env var)', process.env.CODESYS_PROFILE || 'CODESYS V3.5 SP21' // Default AFTER reading env var
|
|
71
37
|
)
|
|
38
|
+
// Add workspace option if needed, defaults to cwd
|
|
72
39
|
.option('-w, --workspace <dir>', 'Workspace directory for relative project paths', process.cwd() // Default to current working directory
|
|
73
40
|
)
|
|
74
|
-
// Add option for the CODESYS scripts directory
|
|
75
|
-
.option('-s, --codesys-scripts-dir <dir>', 'Directory containing CODESYS Python scripts (e.g., listener_script.py)',
|
|
76
|
-
// Default to a 'codesys_scripts' directory relative to the bin.ts file
|
|
77
|
-
path.join(__dirname, '..', 'codesys_scripts'))
|
|
78
41
|
.parse(process.argv); // Parse the arguments
|
|
79
42
|
const options = commander_1.program.opts();
|
|
80
43
|
// --- Log the options Commander parsed ---
|
|
@@ -84,7 +47,6 @@ console.error(`BIN.TS Options: ${JSON.stringify(options)}`);
|
|
|
84
47
|
console.error(` CODESYS Path Used: ${options.codesysPath}`);
|
|
85
48
|
console.error(` CODESYS Profile Used: ${options.codesysProfile}`);
|
|
86
49
|
console.error(` Workspace Used: ${options.workspace}`);
|
|
87
|
-
console.error(` CODESYS Scripts Dir Used: ${options.codesysScriptsDir}`); // Log the new option
|
|
88
50
|
console.error(` Node.js: ${process.version}`);
|
|
89
51
|
console.error(`========================================`);
|
|
90
52
|
// --- End Logging ---
|
|
@@ -92,8 +54,7 @@ console.error(`========================================`);
|
|
|
92
54
|
const serverConfig = {
|
|
93
55
|
codesysPath: options.codesysPath.trim(),
|
|
94
56
|
profileName: options.codesysProfile.trim(),
|
|
95
|
-
workspaceDir: options.workspace.trim()
|
|
96
|
-
codesysScriptsDir: options.codesysScriptsDir.trim() // Pass the scripts directory
|
|
57
|
+
workspaceDir: options.workspace.trim() // Pass workspace dir
|
|
97
58
|
};
|
|
98
59
|
// --- End Prepare Config ---
|
|
99
60
|
// --- Call the server setup function ---
|