@codesys/mcp-toolkit 1.5.1 → 1.5.2

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/CHANGELOG.md CHANGED
@@ -5,6 +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.5.2] - 2025-05-02
9
+ ### Fixed
10
+ - Re-enabled session management feature that was disabled for debugging
11
+ - Fixed project path handling between scripts for more reliable project creation
12
+ - Fixed create_pou.py and set_pou_code.py to properly handle project paths when embedded in other scripts
13
+
8
14
  ## [1.5.1] - 2025-05-02
9
15
  ### Added
10
16
  - Implemented direct session command handling for project creation
@@ -91,8 +91,8 @@ function executeCodesysScript(scriptContent, codesysExePath, codesysProfileName,
91
91
  if (!fs.existsSync(codesysExePath))
92
92
  throw new Error(`CODESYS executable not found at provided path: ${codesysExePath}`);
93
93
  // --- End Pre-checks ---
94
- // Session management feature control - TEMPORARILY DISABLE FOR DEBUGGING
95
- const SESSION_FEATURE_DISABLED = true; // Session feature disabled for now
94
+ // Session management feature control
95
+ const SESSION_FEATURE_DISABLED = false; // Session feature enabled
96
96
  // --- Check if we should use the persistent session ---
97
97
  if (!SESSION_FEATURE_DISABLED && sessionManager) {
98
98
  const sessionState = sessionManager.getState();
@@ -12,11 +12,17 @@ def find_object_by_path_robust(start_node, full_path, target_type_name="object")
12
12
  # Function implementation will be included from find_object_by_path.py
13
13
  pass
14
14
 
15
+ # Define required parameters
15
16
  POU_NAME = "{POU_NAME}"
16
17
  POU_TYPE_STR = "{POU_TYPE_STR}"
17
18
  IMPL_LANGUAGE_STR = "{IMPL_LANGUAGE_STR}"
18
19
  PARENT_PATH_REL = "{PARENT_PATH}"
19
20
 
21
+ # Define the global PROJECT_FILE_PATH for compatibility with ensure_project_open
22
+ # When this script is embedded in other scripts
23
+ if 'PROJECT_FILE_PATH' not in globals():
24
+ PROJECT_FILE_PATH = "{PROJECT_FILE_PATH}"
25
+
20
26
  pou_type_map = {
21
27
  "Program": script_engine.PouType.Program,
22
28
  "FunctionBlock": script_engine.PouType.FunctionBlock,
@@ -7,6 +7,11 @@ PROJECT_FILE_PATH = '{PROJECT_FILE_PATH}'
7
7
  # Optional flag to skip opening the project after creation (useful for sessions)
8
8
  SKIP_OPEN = '{SKIP_OPEN}' == 'true'
9
9
 
10
+ # Define the global PROJECT_FILE_PATH for compatibility with ensure_project_open
11
+ # This is used by some scripts that check the project status
12
+ if 'PROJECT_FILE_PATH' not in globals():
13
+ globals()['PROJECT_FILE_PATH'] = PROJECT_FILE_PATH
14
+
10
15
  # Print raw paths for debugging
11
16
  print("DEBUG: Template path (raw): %s" % repr(TEMPLATE_PROJECT_PATH))
12
17
  print("DEBUG: Project path (raw): %s" % repr(PROJECT_FILE_PATH))
@@ -16,6 +16,11 @@ POU_FULL_PATH = "{POU_FULL_PATH}" # Expecting format like "Application/MyPOU" or
16
16
  DECLARATION_CONTENT = """{DECLARATION_CONTENT}"""
17
17
  IMPLEMENTATION_CONTENT = """{IMPLEMENTATION_CONTENT}"""
18
18
 
19
+ # Define the global PROJECT_FILE_PATH for compatibility with ensure_project_open
20
+ # When this script is embedded in other scripts
21
+ if 'PROJECT_FILE_PATH' not in globals():
22
+ PROJECT_FILE_PATH = "{PROJECT_FILE_PATH}"
23
+
19
24
  try:
20
25
  print("DEBUG: set_pou_code script: POU_FULL_PATH='%s', Project='%s'" % (POU_FULL_PATH, PROJECT_FILE_PATH))
21
26
  primary_project = ensure_project_open(PROJECT_FILE_PATH)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codesys/mcp-toolkit",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "Model Context Protocol (MCP) server for CODESYS automation platform",
5
5
  "main": "dist/server.js",
6
6
  "bin": {