mcp-for-i 0.1.13 → 0.3.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/README.md +27 -0
- package/dist/config/store.js +229 -109
- package/dist/controlplane/auth.js +128 -0
- package/dist/controlplane/clientIntegrationService.js +83 -4
- package/dist/controlplane/commands.js +52 -11
- package/dist/controlplane/connectionService.js +110 -5
- package/dist/controlplane/connectionTest.js +329 -0
- package/dist/controlplane/errors.js +12 -0
- package/dist/controlplane/runtimeService.js +98 -26
- package/dist/controlplane/server.js +178 -11
- package/dist/controlplane/serverShared.js +25 -6
- package/dist/controlplane/serviceManager.js +147 -100
- package/dist/controlplane/ui.js +1783 -920
- package/dist/ibmi/CompileTools.js +29 -1
- package/dist/ibmi/IBMiContent.js +435 -63
- package/dist/ibmi/IbmDocs.js +685 -0
- package/dist/ibmi/LocalLanguageActions.js +129 -3
- package/dist/ibmi/Search.js +158 -52
- package/dist/ibmi/Tools.js +7 -10
- package/dist/ibmi/client.js +220 -31
- package/dist/ibmi/evfevent.js +256 -0
- package/dist/ibmi/knownHosts.js +190 -0
- package/dist/ibmi/libraryList.js +93 -0
- package/dist/ibmi/sourceInspect.js +815 -0
- package/dist/ibmi/sqlJob.js +888 -0
- package/dist/ibmi/sqlParse.js +317 -0
- package/dist/ibmi/tn5250/certTrust.js +59 -0
- package/dist/ibmi/tn5250/client.js +334 -0
- package/dist/ibmi/tn5250/datastream.js +109 -0
- package/dist/ibmi/tn5250/ebcdic.js +93 -0
- package/dist/ibmi/tn5250/ebcdicTables.js +27 -0
- package/dist/ibmi/tn5250/index.js +6 -0
- package/dist/ibmi/tn5250/screen.js +1033 -0
- package/dist/ibmi/tn5250/telnet.js +186 -0
- package/dist/ibmi/variables.js +18 -7
- package/dist/index.js +79 -24
- package/dist/mcp/annotations.js +155 -0
- package/dist/mcp/audit.js +490 -133
- package/dist/mcp/confirm.js +48 -0
- package/dist/mcp/context.js +43 -5
- package/dist/mcp/deployMethods.js +192 -0
- package/dist/mcp/logger.js +5 -10
- package/dist/mcp/modules/bulkMembers.js +476 -0
- package/dist/mcp/modules/changedLines.js +189 -0
- package/dist/mcp/modules/compare.js +198 -0
- package/dist/mcp/modules/compile.js +515 -0
- package/dist/mcp/modules/ifsOps.js +123 -0
- package/dist/mcp/modules/index.js +38 -0
- package/dist/mcp/modules/inspect.js +811 -0
- package/dist/mcp/modules/libl.js +246 -0
- package/dist/mcp/modules/members.js +171 -0
- package/dist/mcp/modules/objects.js +339 -0
- package/dist/mcp/modules/system.js +266 -0
- package/dist/mcp/modules/tn5250.js +800 -0
- package/dist/mcp/modules/tn5250App.js +194 -0
- package/dist/mcp/modules/tn5250Font.js +8 -0
- package/dist/mcp/modules/tn5250Live.js +221 -0
- package/dist/mcp/modules/tn5250LivePage.js +480 -0
- package/dist/mcp/policy.js +412 -0
- package/dist/mcp/tools.js +1719 -698
- package/dist/security/credentialStore.js +62 -13
- package/dist/security/localPaths.js +138 -0
- package/dist/security/redact.js +79 -0
- package/dist/util/atomicWrite.js +101 -0
- package/dist/util/fileLock.js +206 -0
- package/docs/capabilities.md +264 -220
- package/docs/configuration.md +193 -60
- package/docs/examples.md +109 -73
- package/docs/overview.md +15 -15
- package/docs/security.md +101 -16
- package/docs/tools.md +367 -188
- package/package.json +5 -2
|
@@ -58,7 +58,7 @@ export var CompileTools;
|
|
|
58
58
|
commandResult = await connection.sendQsh({
|
|
59
59
|
command: [
|
|
60
60
|
...(options.noLibList ? [] : buildLiblistCommands(connection, ileSetup)),
|
|
61
|
-
...commands.map(cmd => `system
|
|
61
|
+
...commands.map(cmd => `system ${quoteForShell(cmd)}`)
|
|
62
62
|
].join(` && `),
|
|
63
63
|
directory: cwd
|
|
64
64
|
});
|
|
@@ -75,6 +75,27 @@ export var CompileTools;
|
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
CompileTools.runCommand = runCommand;
|
|
78
|
+
/**
|
|
79
|
+
* Validate a streamfile path used as an action target. The path is
|
|
80
|
+
* substituted into CL and shell commands, so quotes, shell metacharacters
|
|
81
|
+
* and control characters are refused.
|
|
82
|
+
*/
|
|
83
|
+
function validateStreamfilePath(value) {
|
|
84
|
+
const target = String(value ?? "");
|
|
85
|
+
if (!target.trim())
|
|
86
|
+
throw new Error("targetPath is required for streamfile actions");
|
|
87
|
+
if (!target.startsWith("/"))
|
|
88
|
+
throw new Error("targetPath must be an absolute IFS path");
|
|
89
|
+
if (/[\u0000-\u001f\u007f]/.test(target))
|
|
90
|
+
throw new Error("targetPath must not contain control characters");
|
|
91
|
+
if (/['"`$\\;|&<>]/.test(target)) {
|
|
92
|
+
throw new Error("targetPath must not contain quotes, backticks, '$', backslash, ';', '|', '&', '<' or '>'");
|
|
93
|
+
}
|
|
94
|
+
if (target.split("/").some(segment => segment === ".."))
|
|
95
|
+
throw new Error("targetPath must not contain '..'");
|
|
96
|
+
return target;
|
|
97
|
+
}
|
|
98
|
+
CompileTools.validateStreamfilePath = validateStreamfilePath;
|
|
78
99
|
function buildLibraryList(config) {
|
|
79
100
|
return config.libraryList
|
|
80
101
|
.slice(0)
|
|
@@ -107,3 +128,10 @@ function assertLibraryName(connection, value, context) {
|
|
|
107
128
|
}
|
|
108
129
|
return normalized;
|
|
109
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* Quote a value as a single POSIX shell word. Inside single quotes nothing is
|
|
133
|
+
* expanded, so `"`, backticks and `$` cannot break out of `system '...'`.
|
|
134
|
+
*/
|
|
135
|
+
export function quoteForShell(value) {
|
|
136
|
+
return `'${String(value).replace(/'/g, `'\\''`)}'`;
|
|
137
|
+
}
|