@codesys/mcp-toolkit 1.5.8 → 2.0.0
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 +153 -189
- package/LICENSE +21 -21
- package/README.md +269 -152
- package/dist/actions.d.ts +28 -0
- package/dist/actions.js +98 -0
- package/dist/actions.js.map +1 -0
- package/dist/bridge/bridge.d.ts +105 -0
- package/dist/bridge/bridge.js +400 -0
- package/dist/bridge/bridge.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +196 -0
- package/dist/cli.js.map +1 -0
- package/dist/codesys/cache.d.ts +48 -0
- package/dist/codesys/cache.js +82 -0
- package/dist/codesys/cache.js.map +1 -0
- package/dist/codesys/changes.d.ts +57 -0
- package/dist/codesys/changes.js +133 -0
- package/dist/codesys/changes.js.map +1 -0
- package/dist/codesys/decl.d.ts +45 -0
- package/dist/codesys/decl.js +251 -0
- package/dist/codesys/decl.js.map +1 -0
- package/dist/codesys/devices.d.ts +34 -0
- package/dist/codesys/devices.js +82 -0
- package/dist/codesys/devices.js.map +1 -0
- package/dist/codesys/diff.d.ts +13 -0
- package/dist/codesys/diff.js +61 -0
- package/dist/codesys/diff.js.map +1 -0
- package/dist/codesys/install.d.ts +40 -0
- package/dist/codesys/install.js +144 -0
- package/dist/codesys/install.js.map +1 -0
- package/dist/codesys/library-browse.d.ts +19 -0
- package/dist/codesys/library-browse.js +57 -0
- package/dist/codesys/library-browse.js.map +1 -0
- package/dist/codesys/outline.d.ts +32 -0
- package/dist/codesys/outline.js +219 -0
- package/dist/codesys/outline.js.map +1 -0
- package/dist/codesys/simulation.d.ts +34 -0
- package/dist/codesys/simulation.js +57 -0
- package/dist/codesys/simulation.js.map +1 -0
- package/dist/codesys/st.d.ts +36 -0
- package/dist/codesys/st.js +69 -0
- package/dist/codesys/st.js.map +1 -0
- package/dist/daemon.d.ts +46 -0
- package/dist/daemon.js +173 -0
- package/dist/daemon.js.map +1 -0
- package/dist/driver.d.ts +25 -0
- package/dist/driver.js +33 -0
- package/dist/driver.js.map +1 -0
- package/dist/panel/sim-panel.html +357 -0
- package/dist/panel/viewer.html +126 -0
- package/dist/panel-types.d.ts +20 -0
- package/dist/panel-types.js +3 -0
- package/dist/panel-types.js.map +1 -0
- package/dist/panel.d.ts +27 -0
- package/dist/panel.js +208 -0
- package/dist/panel.js.map +1 -0
- package/dist/server.d.ts +5 -0
- package/dist/server.js +33 -974
- package/dist/server.js.map +1 -0
- package/dist/tools.d.ts +103 -0
- package/dist/tools.js +793 -0
- package/dist/tools.js.map +1 -0
- package/dist/viewer.d.ts +14 -0
- package/dist/viewer.js +125 -0
- package/dist/viewer.js.map +1 -0
- package/package.json +66 -51
- package/watcher/mcp_compat.py +147 -0
- package/watcher/mcp_ops.py +1178 -0
- package/watcher/mcp_sim.py +246 -0
- package/watcher/watcher.py +255 -0
- package/.claude/settings.local.json +0 -29
- package/CLAUDE.md +0 -26
- package/CONTRIBUTING.md +0 -72
- package/README.md.enhanced +0 -155
- package/codesys-mcp-toolkit-1.2.0.tgz +0 -0
- package/codesys-mcp-toolkit-1.2.1.tgz +0 -0
- package/codesys-mcp-toolkit-1.5.7.tgz +0 -0
- package/codesys-mcp-toolkit-1.5.8.tgz +0 -0
- package/dist/bin.js +0 -75
- package/dist/check_session_paths.js +0 -149
- package/dist/codesys_interop.js +0 -435
- package/dist/direct_session_command.js +0 -293
- package/dist/scriptLoader.js +0 -165
- package/dist/scripts/check_status.py +0 -21
- package/dist/scripts/compile_project.py +0 -65
- package/dist/scripts/create_method.py +0 -80
- package/dist/scripts/create_pou.py +0 -102
- package/dist/scripts/create_project.py +0 -116
- package/dist/scripts/create_property.py +0 -78
- package/dist/scripts/ensure_project_open.py +0 -154
- package/dist/scripts/find_object_by_path.py +0 -111
- package/dist/scripts/get_pou_code.py +0 -91
- package/dist/scripts/get_project_structure.py +0 -72
- package/dist/scripts/open_project.py +0 -25
- package/dist/scripts/save_project.py +0 -29
- package/dist/scripts/session_status.py +0 -281
- package/dist/scripts/set_pou_code.py +0 -109
- package/dist/scripts/start_session.py +0 -809
- package/dist/scripts/stop_session.py +0 -324
- package/dist/sessionManager.js +0 -798
- package/docs/configuration.md +0 -141
- package/docs/index.md +0 -26
- package/docs/installation.md +0 -84
- package/docs/session_management.md +0 -110
- package/examples/README.md +0 -78
- package/examples/sample_config.json +0 -32
- package/replacements_session_status.txt +0 -16
- package/scriptDoc.txt +0 -8679
- package/scripts/build.js +0 -25
- package/scripts/fix_fstrings.py +0 -76
package/scripts/build.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
// Create the dist/scripts directory if it doesn't exist
|
|
5
|
-
const scriptsDir = path.join(__dirname, '../src/scripts');
|
|
6
|
-
const distScriptsDir = path.join(__dirname, '../dist/scripts');
|
|
7
|
-
|
|
8
|
-
if (!fs.existsSync(distScriptsDir)) {
|
|
9
|
-
fs.mkdirSync(distScriptsDir, { recursive: true });
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// Copy all Python scripts from src/scripts to dist/scripts
|
|
13
|
-
const scriptFiles = fs.readdirSync(scriptsDir);
|
|
14
|
-
console.log(`Copying ${scriptFiles.length} Python scripts to dist/scripts...`);
|
|
15
|
-
|
|
16
|
-
for (const file of scriptFiles) {
|
|
17
|
-
if (file.endsWith('.py')) {
|
|
18
|
-
const srcPath = path.join(scriptsDir, file);
|
|
19
|
-
const destPath = path.join(distScriptsDir, file);
|
|
20
|
-
fs.copyFileSync(srcPath, destPath);
|
|
21
|
-
console.log(`Copied ${file}`);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
console.log('All Python scripts copied successfully!');
|
package/scripts/fix_fstrings.py
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""
|
|
3
|
-
Script to fix f-strings in Python files to make them compatible with IronPython 2.7.
|
|
4
|
-
Converts f-strings to str.format() calls.
|
|
5
|
-
"""
|
|
6
|
-
|
|
7
|
-
import re
|
|
8
|
-
import sys
|
|
9
|
-
import os
|
|
10
|
-
|
|
11
|
-
def process_file(filepath):
|
|
12
|
-
print(f"Processing {filepath}")
|
|
13
|
-
with open(filepath, 'r', encoding='utf-8') as f:
|
|
14
|
-
content = f.read()
|
|
15
|
-
|
|
16
|
-
# Find and replace f-strings
|
|
17
|
-
# This is a simplified approach - complex nested expressions might need manual review
|
|
18
|
-
pattern = r'f"([^"]*\{[^}]+\}[^"]*)"'
|
|
19
|
-
|
|
20
|
-
# Count potential matches
|
|
21
|
-
matches = re.findall(pattern, content)
|
|
22
|
-
print(f"Found {len(matches)} potential f-strings")
|
|
23
|
-
|
|
24
|
-
# Function to convert each match
|
|
25
|
-
def replace_fstring(match):
|
|
26
|
-
template_str = match.group(1)
|
|
27
|
-
# Replace {var} with {0}, {1}, etc.
|
|
28
|
-
var_pattern = r'\{([^}:]+)(?::([^}]+))?\}'
|
|
29
|
-
var_matches = re.finditer(var_pattern, template_str)
|
|
30
|
-
|
|
31
|
-
format_args = []
|
|
32
|
-
i = 0
|
|
33
|
-
|
|
34
|
-
new_template = template_str
|
|
35
|
-
for m in var_matches:
|
|
36
|
-
var_name = m.group(1)
|
|
37
|
-
format_spec = m.group(2)
|
|
38
|
-
|
|
39
|
-
if format_spec:
|
|
40
|
-
repl = "{" + str(i) + ":" + format_spec + "}"
|
|
41
|
-
else:
|
|
42
|
-
repl = "{" + str(i) + "}"
|
|
43
|
-
|
|
44
|
-
# Store the argument
|
|
45
|
-
format_args.append(var_name)
|
|
46
|
-
|
|
47
|
-
# Replace in the template
|
|
48
|
-
new_template = new_template.replace(m.group(0), repl, 1)
|
|
49
|
-
i += 1
|
|
50
|
-
|
|
51
|
-
# Build the complete format expression
|
|
52
|
-
args_str = ", ".join(format_args)
|
|
53
|
-
return f'"{new_template}".format({args_str})'
|
|
54
|
-
|
|
55
|
-
# Apply the replacements
|
|
56
|
-
new_content = re.sub(pattern, replace_fstring, content)
|
|
57
|
-
|
|
58
|
-
# Write the changes back
|
|
59
|
-
with open(filepath, 'w', encoding='utf-8') as f:
|
|
60
|
-
f.write(new_content)
|
|
61
|
-
|
|
62
|
-
print(f"Completed processing {filepath}")
|
|
63
|
-
|
|
64
|
-
def main():
|
|
65
|
-
if len(sys.argv) < 2:
|
|
66
|
-
print("Usage: python fix_fstrings.py <file_paths...>")
|
|
67
|
-
sys.exit(1)
|
|
68
|
-
|
|
69
|
-
for file_path in sys.argv[1:]:
|
|
70
|
-
if os.path.exists(file_path):
|
|
71
|
-
process_file(file_path)
|
|
72
|
-
else:
|
|
73
|
-
print(f"Error: File {file_path} not found")
|
|
74
|
-
|
|
75
|
-
if __name__ == "__main__":
|
|
76
|
-
main()
|