@ibm/ibmi-mcp-server 0.4.5 → 0.5.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 +2 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +58 -0
- package/dist/config/index.js.map +1 -1
- package/dist/ibmi-mcp-server/schemas/config.d.ts +58 -0
- package/dist/ibmi-mcp-server/schemas/config.d.ts.map +1 -1
- package/dist/ibmi-mcp-server/schemas/config.js +35 -0
- package/dist/ibmi-mcp-server/schemas/config.js.map +1 -1
- package/dist/ibmi-mcp-server/services/authenticatedPoolManager.d.ts +18 -1
- package/dist/ibmi-mcp-server/services/authenticatedPoolManager.d.ts.map +1 -1
- package/dist/ibmi-mcp-server/services/authenticatedPoolManager.js +30 -2
- package/dist/ibmi-mcp-server/services/authenticatedPoolManager.js.map +1 -1
- package/dist/ibmi-mcp-server/services/baseConnectionPool.d.ts +5 -2
- package/dist/ibmi-mcp-server/services/baseConnectionPool.d.ts.map +1 -1
- package/dist/ibmi-mcp-server/services/baseConnectionPool.js +45 -3
- package/dist/ibmi-mcp-server/services/baseConnectionPool.js.map +1 -1
- package/dist/ibmi-mcp-server/services/connectionPool.d.ts +3 -2
- package/dist/ibmi-mcp-server/services/connectionPool.d.ts.map +1 -1
- package/dist/ibmi-mcp-server/services/connectionPool.js +5 -2
- package/dist/ibmi-mcp-server/services/connectionPool.js.map +1 -1
- package/dist/ibmi-mcp-server/services/sourceManager.d.ts +18 -1
- package/dist/ibmi-mcp-server/services/sourceManager.d.ts.map +1 -1
- package/dist/ibmi-mcp-server/services/sourceManager.js +31 -2
- package/dist/ibmi-mcp-server/services/sourceManager.js.map +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolConfigBuilder.d.ts.map +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolConfigBuilder.js +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolConfigBuilder.js.map +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolFactory.d.ts +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolFactory.d.ts.map +1 -1
- package/dist/ibmi-mcp-server/utils/config/toolFactory.js +47 -4
- package/dist/ibmi-mcp-server/utils/config/toolFactory.js.map +1 -1
- package/dist/public/context.d.ts +5 -0
- package/dist/public/context.d.ts.map +1 -0
- package/dist/public/context.js +5 -0
- package/dist/public/context.js.map +1 -0
- package/dist/public/formatting.d.ts +5 -0
- package/dist/public/formatting.d.ts.map +1 -0
- package/dist/public/formatting.js +5 -0
- package/dist/public/formatting.js.map +1 -0
- package/dist/public/services.d.ts +8 -0
- package/dist/public/services.d.ts.map +1 -0
- package/dist/public/services.js +8 -0
- package/dist/public/services.js.map +1 -0
- package/dist/public/tools.d.ts +16 -0
- package/dist/public/tools.d.ts.map +1 -0
- package/dist/public/tools.js +15 -0
- package/dist/public/tools.js.map +1 -0
- package/package.json +20 -17
- package/dist/cli/commands/columns.d.ts +0 -7
- package/dist/cli/commands/columns.d.ts.map +0 -1
- package/dist/cli/commands/columns.js +0 -29
- package/dist/cli/commands/columns.js.map +0 -1
- package/dist/cli/commands/completion.d.ts +0 -10
- package/dist/cli/commands/completion.d.ts.map +0 -1
- package/dist/cli/commands/completion.js +0 -247
- package/dist/cli/commands/completion.js.map +0 -1
- package/dist/cli/commands/config.d.ts +0 -11
- package/dist/cli/commands/config.d.ts.map +0 -1
- package/dist/cli/commands/config.js +0 -124
- package/dist/cli/commands/config.js.map +0 -1
- package/dist/cli/commands/describe.d.ts +0 -9
- package/dist/cli/commands/describe.d.ts.map +0 -1
- package/dist/cli/commands/describe.js +0 -82
- package/dist/cli/commands/describe.js.map +0 -1
- package/dist/cli/commands/related.d.ts +0 -7
- package/dist/cli/commands/related.d.ts.map +0 -1
- package/dist/cli/commands/related.js +0 -32
- package/dist/cli/commands/related.js.map +0 -1
- package/dist/cli/commands/schemas.d.ts +0 -7
- package/dist/cli/commands/schemas.d.ts.map +0 -1
- package/dist/cli/commands/schemas.js +0 -49
- package/dist/cli/commands/schemas.js.map +0 -1
- package/dist/cli/commands/sql.d.ts +0 -8
- package/dist/cli/commands/sql.d.ts.map +0 -1
- package/dist/cli/commands/sql.js +0 -187
- package/dist/cli/commands/sql.js.map +0 -1
- package/dist/cli/commands/system.d.ts +0 -11
- package/dist/cli/commands/system.d.ts.map +0 -1
- package/dist/cli/commands/system.js +0 -263
- package/dist/cli/commands/system.js.map +0 -1
- package/dist/cli/commands/tables.d.ts +0 -7
- package/dist/cli/commands/tables.d.ts.map +0 -1
- package/dist/cli/commands/tables.js +0 -48
- package/dist/cli/commands/tables.js.map +0 -1
- package/dist/cli/commands/tool.d.ts +0 -18
- package/dist/cli/commands/tool.d.ts.map +0 -1
- package/dist/cli/commands/tool.js +0 -194
- package/dist/cli/commands/tool.js.map +0 -1
- package/dist/cli/commands/tools-list.d.ts +0 -20
- package/dist/cli/commands/tools-list.d.ts.map +0 -1
- package/dist/cli/commands/tools-list.js +0 -209
- package/dist/cli/commands/tools-list.js.map +0 -1
- package/dist/cli/commands/validate.d.ts +0 -7
- package/dist/cli/commands/validate.d.ts.map +0 -1
- package/dist/cli/commands/validate.js +0 -77
- package/dist/cli/commands/validate.js.map +0 -1
- package/dist/cli/config/credentials.d.ts +0 -21
- package/dist/cli/config/credentials.d.ts.map +0 -1
- package/dist/cli/config/credentials.js +0 -96
- package/dist/cli/config/credentials.js.map +0 -1
- package/dist/cli/config/index.d.ts +0 -11
- package/dist/cli/config/index.d.ts.map +0 -1
- package/dist/cli/config/index.js +0 -9
- package/dist/cli/config/index.js.map +0 -1
- package/dist/cli/config/loader.d.ts +0 -52
- package/dist/cli/config/loader.d.ts.map +0 -1
- package/dist/cli/config/loader.js +0 -237
- package/dist/cli/config/loader.js.map +0 -1
- package/dist/cli/config/resolver.d.ts +0 -31
- package/dist/cli/config/resolver.d.ts.map +0 -1
- package/dist/cli/config/resolver.js +0 -115
- package/dist/cli/config/resolver.js.map +0 -1
- package/dist/cli/config/schema.d.ts +0 -128
- package/dist/cli/config/schema.d.ts.map +0 -1
- package/dist/cli/config/schema.js +0 -37
- package/dist/cli/config/schema.js.map +0 -1
- package/dist/cli/config/types.d.ts +0 -59
- package/dist/cli/config/types.d.ts.map +0 -1
- package/dist/cli/config/types.js +0 -6
- package/dist/cli/config/types.js.map +0 -1
- package/dist/cli/formatters/output.d.ts +0 -70
- package/dist/cli/formatters/output.d.ts.map +0 -1
- package/dist/cli/formatters/output.js +0 -279
- package/dist/cli/formatters/output.js.map +0 -1
- package/dist/cli/index.d.ts +0 -13
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -102
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/utils/command-helpers.d.ts +0 -47
- package/dist/cli/utils/command-helpers.d.ts.map +0 -1
- package/dist/cli/utils/command-helpers.js +0 -211
- package/dist/cli/utils/command-helpers.js.map +0 -1
- package/dist/cli/utils/connection.d.ts +0 -20
- package/dist/cli/utils/connection.d.ts.map +0 -1
- package/dist/cli/utils/connection.js +0 -37
- package/dist/cli/utils/connection.js.map +0 -1
- package/dist/cli/utils/exit-codes.d.ts +0 -48
- package/dist/cli/utils/exit-codes.d.ts.map +0 -1
- package/dist/cli/utils/exit-codes.js +0 -111
- package/dist/cli/utils/exit-codes.js.map +0 -1
- package/dist/cli/utils/multi-connection.d.ts +0 -26
- package/dist/cli/utils/multi-connection.d.ts.map +0 -1
- package/dist/cli/utils/multi-connection.js +0 -72
- package/dist/cli/utils/multi-connection.js.map +0 -1
- package/dist/cli/utils/yaml-loader.d.ts +0 -69
- package/dist/cli/utils/yaml-loader.d.ts.map +0 -1
- package/dist/cli/utils/yaml-loader.js +0 -135
- package/dist/cli/utils/yaml-loader.js.map +0 -1
- package/dist/cli/utils/yaml-to-commander.d.ts +0 -26
- package/dist/cli/utils/yaml-to-commander.d.ts.map +0 -1
- package/dist/cli/utils/yaml-to-commander.js +0 -156
- package/dist/cli/utils/yaml-to-commander.js.map +0 -1
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Shared utilities for CLI command implementations.
|
|
3
|
-
* Provides the `withConnection` wrapper that handles the full lifecycle
|
|
4
|
-
* of system resolution, connection setup, execution, rendering, and cleanup.
|
|
5
|
-
*
|
|
6
|
-
* @module cli/utils/command-helpers
|
|
7
|
-
*/
|
|
8
|
-
import { loadConfig } from "../config/loader.js";
|
|
9
|
-
import { resolveSystem } from "../config/resolver.js";
|
|
10
|
-
import { connectSystem } from "./connection.js";
|
|
11
|
-
import { classifyError } from "./exit-codes.js";
|
|
12
|
-
import { detectFormat, renderOutput, renderNdjson, renderError, setOutputFile, finalizeOutput, } from "../formatters/output.js";
|
|
13
|
-
/**
|
|
14
|
-
* Get the effective output format from parent command options and config.
|
|
15
|
-
*
|
|
16
|
-
* Priority: --raw → --format → config format → TTY auto-detect.
|
|
17
|
-
*/
|
|
18
|
-
export function getFormat(cmd) {
|
|
19
|
-
const opts = cmd.optsWithGlobals();
|
|
20
|
-
let configFormat;
|
|
21
|
-
try {
|
|
22
|
-
configFormat = loadConfig().format;
|
|
23
|
-
}
|
|
24
|
-
catch {
|
|
25
|
-
// Config may not exist — fall through to auto-detect
|
|
26
|
-
}
|
|
27
|
-
return detectFormat(opts["format"], opts["raw"], configFormat);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Check if --stream mode is enabled.
|
|
31
|
-
*/
|
|
32
|
-
export function isStreaming(cmd) {
|
|
33
|
-
const opts = cmd.optsWithGlobals();
|
|
34
|
-
return opts["stream"] === true;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Create a minimal RequestContext for CLI tool execution.
|
|
38
|
-
* Avoids importing the full server utils (which would trigger OpenTelemetry).
|
|
39
|
-
*/
|
|
40
|
-
export function createCliContext(toolName) {
|
|
41
|
-
return {
|
|
42
|
-
requestId: `cli-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
|
|
43
|
-
timestamp: new Date().toISOString(),
|
|
44
|
-
operation: "CliToolExecution",
|
|
45
|
-
toolName,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Standard command action wrapper.
|
|
50
|
-
*
|
|
51
|
-
* Handles the full lifecycle:
|
|
52
|
-
* 1. Resolve target system from --system flag / env / config
|
|
53
|
-
* 2. Connect (set env vars for IBMiConnectionPool)
|
|
54
|
-
* 3. Run the action callback
|
|
55
|
-
* 4. Render output in the requested format (or NDJSON if --stream)
|
|
56
|
-
* 5. Cleanup (close pool) in finally block
|
|
57
|
-
* 6. Set semantic exit code on error
|
|
58
|
-
*
|
|
59
|
-
* When --watch <seconds> is set, the connect-execute-render cycle repeats
|
|
60
|
-
* at the given interval until Ctrl+C is received.
|
|
61
|
-
*/
|
|
62
|
-
export async function withConnection(cmd, toolName, action) {
|
|
63
|
-
const format = getFormat(cmd);
|
|
64
|
-
const stream = isStreaming(cmd);
|
|
65
|
-
const opts = cmd.optsWithGlobals();
|
|
66
|
-
const outputPath = opts["output"];
|
|
67
|
-
const watchInterval = opts["watch"] ? parseInt(opts["watch"], 10) : undefined;
|
|
68
|
-
if (outputPath) {
|
|
69
|
-
setOutputFile(outputPath);
|
|
70
|
-
}
|
|
71
|
-
if (watchInterval && watchInterval > 0) {
|
|
72
|
-
try {
|
|
73
|
-
await runWithWatch(cmd, toolName, action, format, stream, watchInterval);
|
|
74
|
-
}
|
|
75
|
-
finally {
|
|
76
|
-
if (outputPath)
|
|
77
|
-
finalizeOutput();
|
|
78
|
-
}
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
let cleanup;
|
|
82
|
-
let resolved;
|
|
83
|
-
try {
|
|
84
|
-
resolved = resolveSystem(opts["system"]);
|
|
85
|
-
cleanup = await connectSystem(resolved);
|
|
86
|
-
const ctx = createCliContext(toolName);
|
|
87
|
-
const startTime = Date.now();
|
|
88
|
-
const result = await action(resolved, ctx);
|
|
89
|
-
const elapsedMs = Date.now() - startTime;
|
|
90
|
-
// NDJSON streaming: one JSON object per line, no envelope
|
|
91
|
-
if (stream && format === "json") {
|
|
92
|
-
renderNdjson(result.data);
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
renderOutput(result.data, format, {
|
|
96
|
-
rowCount: result.data.length,
|
|
97
|
-
elapsedMs,
|
|
98
|
-
system: resolved,
|
|
99
|
-
command: toolName,
|
|
100
|
-
...result.meta,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
catch (err) {
|
|
104
|
-
const error = err instanceof Error ? err : new Error(String(err));
|
|
105
|
-
const classified = classifyError(error);
|
|
106
|
-
renderError(error, format, resolved, classified.errorCode);
|
|
107
|
-
process.exitCode = classified.exitCode;
|
|
108
|
-
}
|
|
109
|
-
finally {
|
|
110
|
-
if (cleanup)
|
|
111
|
-
await cleanup();
|
|
112
|
-
if (outputPath)
|
|
113
|
-
finalizeOutput();
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Strip sensitive flags (e.g. --password) from argv before displaying.
|
|
118
|
-
*/
|
|
119
|
-
function sanitizeArgsForDisplay(args) {
|
|
120
|
-
const sensitiveFlags = ["--password"];
|
|
121
|
-
const sanitized = [];
|
|
122
|
-
for (let i = 0; i < args.length; i++) {
|
|
123
|
-
const arg = args[i];
|
|
124
|
-
if (sensitiveFlags.some((f) => arg === f || arg.startsWith(`${f}=`))) {
|
|
125
|
-
if (!arg.includes("="))
|
|
126
|
-
i++; // skip next arg (the value)
|
|
127
|
-
sanitized.push("--password ****");
|
|
128
|
-
continue;
|
|
129
|
-
}
|
|
130
|
-
sanitized.push(arg);
|
|
131
|
-
}
|
|
132
|
-
return sanitized.join(" ");
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Run a command repeatedly at the specified interval.
|
|
136
|
-
* Clears the screen between runs in table/markdown/csv mode (not JSON/NDJSON,
|
|
137
|
-
* which are intended for piping). Shows a timestamp header on stderr.
|
|
138
|
-
* Ctrl+C exits cleanly.
|
|
139
|
-
*/
|
|
140
|
-
async function runWithWatch(cmd, toolName, action, format, stream, intervalSeconds) {
|
|
141
|
-
let running = true;
|
|
142
|
-
// Primary SIGINT handler to stop the loop
|
|
143
|
-
const handler = () => {
|
|
144
|
-
running = false;
|
|
145
|
-
};
|
|
146
|
-
process.on("SIGINT", handler);
|
|
147
|
-
try {
|
|
148
|
-
while (running) {
|
|
149
|
-
// Clear screen for human-readable formats; leave JSON/NDJSON clean for piping
|
|
150
|
-
if (format !== "json") {
|
|
151
|
-
process.stdout.write("\x1b[2J\x1b[H");
|
|
152
|
-
}
|
|
153
|
-
// Show timestamp header so the user knows when the last refresh happened
|
|
154
|
-
const now = new Date().toLocaleString();
|
|
155
|
-
const args = sanitizeArgsForDisplay(process.argv.slice(2));
|
|
156
|
-
process.stderr.write(`Every ${intervalSeconds}s: ibmi ${args} ${now}\n\n`);
|
|
157
|
-
// Run one connect-execute-render cycle
|
|
158
|
-
let cleanup;
|
|
159
|
-
try {
|
|
160
|
-
const opts = cmd.optsWithGlobals();
|
|
161
|
-
const resolved = resolveSystem(opts["system"]);
|
|
162
|
-
cleanup = await connectSystem(resolved);
|
|
163
|
-
const ctx = createCliContext(toolName);
|
|
164
|
-
const startTime = Date.now();
|
|
165
|
-
const result = await action(resolved, ctx);
|
|
166
|
-
const elapsedMs = Date.now() - startTime;
|
|
167
|
-
if (stream && format === "json") {
|
|
168
|
-
renderNdjson(result.data);
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
renderOutput(result.data, format, {
|
|
172
|
-
rowCount: result.data.length,
|
|
173
|
-
elapsedMs,
|
|
174
|
-
system: resolved,
|
|
175
|
-
command: toolName,
|
|
176
|
-
...result.meta,
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
catch (err) {
|
|
181
|
-
const error = err instanceof Error ? err : new Error(String(err));
|
|
182
|
-
const classified = classifyError(error);
|
|
183
|
-
renderError(error, format, undefined, classified.errorCode);
|
|
184
|
-
}
|
|
185
|
-
finally {
|
|
186
|
-
if (cleanup)
|
|
187
|
-
await cleanup();
|
|
188
|
-
}
|
|
189
|
-
// Wait for the interval, but allow SIGINT to break out immediately
|
|
190
|
-
if (running) {
|
|
191
|
-
await new Promise((resolve) => {
|
|
192
|
-
const timer = setTimeout(resolve, intervalSeconds * 1000);
|
|
193
|
-
const sigHandler = () => {
|
|
194
|
-
clearTimeout(timer);
|
|
195
|
-
running = false;
|
|
196
|
-
resolve();
|
|
197
|
-
};
|
|
198
|
-
process.once("SIGINT", sigHandler);
|
|
199
|
-
// Remove the per-iteration handler once the timer fires naturally
|
|
200
|
-
setTimeout(() => {
|
|
201
|
-
process.removeListener("SIGINT", sigHandler);
|
|
202
|
-
}, intervalSeconds * 1000 + 10);
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
finally {
|
|
208
|
-
process.removeListener("SIGINT", handler);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
//# sourceMappingURL=command-helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command-helpers.js","sourceRoot":"","sources":["../../../src/cli/utils/command-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,EACb,cAAc,GAEf,MAAM,yBAAyB,CAAC;AAEjC;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,GAAY;IACpC,MAAM,IAAI,GAAG,GAAG,CAAC,eAAe,EAAE,CAAC;IACnC,IAAI,YAAsC,CAAC;IA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AC,CAAC;oBAC/C,CAAC,EAAE,eAAe,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC;gBAClC,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Connection bridge for the IBM i CLI.
|
|
3
|
-
* Maps resolved system config into DB2i_* environment variables that
|
|
4
|
-
* IBMiConnectionPool reads via the global config singleton.
|
|
5
|
-
*
|
|
6
|
-
* Must be called BEFORE dynamic-importing any tool modules, since
|
|
7
|
-
* the server's config/index.ts evaluates env vars at import time.
|
|
8
|
-
*
|
|
9
|
-
* @module cli/utils/connection
|
|
10
|
-
*/
|
|
11
|
-
import type { ResolvedSystem } from "../config/types.js";
|
|
12
|
-
/**
|
|
13
|
-
* Set DB2i_* environment variables from resolved system config and
|
|
14
|
-
* return a cleanup function to close the connection pool.
|
|
15
|
-
*
|
|
16
|
-
* Call this before dynamically importing tool modules so the global
|
|
17
|
-
* config singleton picks up the correct credentials.
|
|
18
|
-
*/
|
|
19
|
-
export declare function connectSystem(resolved: ResolvedSystem): Promise<() => Promise<void>>;
|
|
20
|
-
//# sourceMappingURL=connection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/connection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;;;;;GAMG;AACH,wBAAsB,aAAa,CACjC,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,CA2B9B"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Connection bridge for the IBM i CLI.
|
|
3
|
-
* Maps resolved system config into DB2i_* environment variables that
|
|
4
|
-
* IBMiConnectionPool reads via the global config singleton.
|
|
5
|
-
*
|
|
6
|
-
* Must be called BEFORE dynamic-importing any tool modules, since
|
|
7
|
-
* the server's config/index.ts evaluates env vars at import time.
|
|
8
|
-
*
|
|
9
|
-
* @module cli/utils/connection
|
|
10
|
-
*/
|
|
11
|
-
import { resolvePassword } from "../config/credentials.js";
|
|
12
|
-
/**
|
|
13
|
-
* Set DB2i_* environment variables from resolved system config and
|
|
14
|
-
* return a cleanup function to close the connection pool.
|
|
15
|
-
*
|
|
16
|
-
* Call this before dynamically importing tool modules so the global
|
|
17
|
-
* config singleton picks up the correct credentials.
|
|
18
|
-
*/
|
|
19
|
-
export async function connectSystem(resolved) {
|
|
20
|
-
const password = await resolvePassword(resolved.name, resolved.config.password, resolved.config.user, resolved.config.host);
|
|
21
|
-
// Set env vars for IBMiConnectionPool (reads from global config singleton)
|
|
22
|
-
process.env.DB2i_HOST = resolved.config.host;
|
|
23
|
-
process.env.DB2i_USER = resolved.config.user;
|
|
24
|
-
process.env.DB2i_PASS = password;
|
|
25
|
-
process.env.DB2i_IGNORE_UNAUTHORIZED = String(resolved.config.ignoreUnauthorized);
|
|
26
|
-
// Return cleanup function
|
|
27
|
-
return async () => {
|
|
28
|
-
try {
|
|
29
|
-
const { IBMiConnectionPool } = await import("../../ibmi-mcp-server/services/connectionPool.js");
|
|
30
|
-
await IBMiConnectionPool.close();
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
// Ignore cleanup errors
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=connection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/cli/utils/connection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,QAAwB;IAExB,MAAM,QAAQ,GAAG,MAAM,eAAe,CACpC,QAAQ,CAAC,IAAI,EACb,QAAQ,CAAC,MAAM,CAAC,QAAQ,EACxB,QAAQ,CAAC,MAAM,CAAC,IAAI,EACpB,QAAQ,CAAC,MAAM,CAAC,IAAI,CACrB,CAAC;IAEF,2EAA2E;IAC3E,OAAO,CAAC,GAAG,CAAC,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,SAAS,GAAG,QAAQ,CAAC;IACjC,OAAO,CAAC,GAAG,CAAC,wBAAwB,GAAG,MAAM,CAC3C,QAAQ,CAAC,MAAM,CAAC,kBAAkB,CACnC,CAAC;IAEF,0BAA0B;IAC1B,OAAO,KAAK,IAAI,EAAE;QAChB,IAAI,CAAC;YACH,MAAM,EAAE,kBAAkB,EAAE,GAAG,MAAM,MAAM,CACzC,kDAAkD,CACnD,CAAC;YACF,MAAM,kBAAkB,CAAC,KAAK,EAAE,CAAC;QACnC,CAAC;QAAC,MAAM,CAAC;YACP,wBAAwB;QAC1B,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview CLI exit codes and error classification.
|
|
3
|
-
* Provides semantic exit codes for agent and script consumption.
|
|
4
|
-
* @module cli/utils/exit-codes
|
|
5
|
-
*/
|
|
6
|
-
/** CLI exit codes for different error categories. */
|
|
7
|
-
export declare const ExitCode: {
|
|
8
|
-
/** Command completed successfully. */
|
|
9
|
-
readonly SUCCESS: 0;
|
|
10
|
-
/** General error (connection failure, unexpected error). */
|
|
11
|
-
readonly GENERAL: 1;
|
|
12
|
-
/** Invalid arguments or usage error. */
|
|
13
|
-
readonly USAGE: 2;
|
|
14
|
-
/** Query execution error (SQL error). */
|
|
15
|
-
readonly QUERY: 3;
|
|
16
|
-
/** Security violation (read-only system, forbidden keyword). */
|
|
17
|
-
readonly SECURITY: 4;
|
|
18
|
-
/** Authentication failure (bad credentials, missing password). */
|
|
19
|
-
readonly AUTH: 5;
|
|
20
|
-
};
|
|
21
|
-
export type ExitCodeValue = (typeof ExitCode)[keyof typeof ExitCode];
|
|
22
|
-
/** Error code strings for structured JSON error output. */
|
|
23
|
-
export declare const ErrorCode: {
|
|
24
|
-
readonly GENERAL_ERROR: "GENERAL_ERROR";
|
|
25
|
-
readonly USAGE_ERROR: "USAGE_ERROR";
|
|
26
|
-
readonly CONNECTION_ERROR: "CONNECTION_ERROR";
|
|
27
|
-
readonly QUERY_ERROR: "QUERY_ERROR";
|
|
28
|
-
readonly SQL_ERROR: "SQL_ERROR";
|
|
29
|
-
readonly SECURITY_VIOLATION: "SECURITY_VIOLATION";
|
|
30
|
-
readonly AUTH_FAILURE: "AUTH_FAILURE";
|
|
31
|
-
readonly NOT_FOUND: "NOT_FOUND";
|
|
32
|
-
readonly TIMEOUT: "TIMEOUT";
|
|
33
|
-
};
|
|
34
|
-
export type ErrorCodeValue = (typeof ErrorCode)[keyof typeof ErrorCode];
|
|
35
|
-
/** Classified error with exit code and error code. */
|
|
36
|
-
export interface ClassifiedError {
|
|
37
|
-
exitCode: ExitCodeValue;
|
|
38
|
-
errorCode: ErrorCodeValue;
|
|
39
|
-
message: string;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Classify an error into an exit code and error code based on its message and type.
|
|
43
|
-
*
|
|
44
|
-
* Pattern matching is intentionally broad — we check common patterns from
|
|
45
|
-
* Mapepire, SqlSecurityValidator, and our own error messages.
|
|
46
|
-
*/
|
|
47
|
-
export declare function classifyError(error: Error): ClassifiedError;
|
|
48
|
-
//# sourceMappingURL=exit-codes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exit-codes.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/exit-codes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,qDAAqD;AACrD,eAAO,MAAM,QAAQ;IACnB,sCAAsC;;IAEtC,4DAA4D;;IAE5D,wCAAwC;;IAExC,yCAAyC;;IAEzC,gEAAgE;;IAEhE,kEAAkE;;CAE1D,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAErE,2DAA2D;AAC3D,eAAO,MAAM,SAAS;;;;;;;;;;CAUZ,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAExE,sDAAsD;AACtD,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,aAAa,CAAC;IACxB,SAAS,EAAE,cAAc,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,eAAe,CAuF3D"}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview CLI exit codes and error classification.
|
|
3
|
-
* Provides semantic exit codes for agent and script consumption.
|
|
4
|
-
* @module cli/utils/exit-codes
|
|
5
|
-
*/
|
|
6
|
-
/** CLI exit codes for different error categories. */
|
|
7
|
-
export const ExitCode = {
|
|
8
|
-
/** Command completed successfully. */
|
|
9
|
-
SUCCESS: 0,
|
|
10
|
-
/** General error (connection failure, unexpected error). */
|
|
11
|
-
GENERAL: 1,
|
|
12
|
-
/** Invalid arguments or usage error. */
|
|
13
|
-
USAGE: 2,
|
|
14
|
-
/** Query execution error (SQL error). */
|
|
15
|
-
QUERY: 3,
|
|
16
|
-
/** Security violation (read-only system, forbidden keyword). */
|
|
17
|
-
SECURITY: 4,
|
|
18
|
-
/** Authentication failure (bad credentials, missing password). */
|
|
19
|
-
AUTH: 5,
|
|
20
|
-
};
|
|
21
|
-
/** Error code strings for structured JSON error output. */
|
|
22
|
-
export const ErrorCode = {
|
|
23
|
-
GENERAL_ERROR: "GENERAL_ERROR",
|
|
24
|
-
USAGE_ERROR: "USAGE_ERROR",
|
|
25
|
-
CONNECTION_ERROR: "CONNECTION_ERROR",
|
|
26
|
-
QUERY_ERROR: "QUERY_ERROR",
|
|
27
|
-
SQL_ERROR: "SQL_ERROR",
|
|
28
|
-
SECURITY_VIOLATION: "SECURITY_VIOLATION",
|
|
29
|
-
AUTH_FAILURE: "AUTH_FAILURE",
|
|
30
|
-
NOT_FOUND: "NOT_FOUND",
|
|
31
|
-
TIMEOUT: "TIMEOUT",
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Classify an error into an exit code and error code based on its message and type.
|
|
35
|
-
*
|
|
36
|
-
* Pattern matching is intentionally broad — we check common patterns from
|
|
37
|
-
* Mapepire, SqlSecurityValidator, and our own error messages.
|
|
38
|
-
*/
|
|
39
|
-
export function classifyError(error) {
|
|
40
|
-
const msg = error.message.toLowerCase();
|
|
41
|
-
// Authentication failures
|
|
42
|
-
if (msg.includes("authentication") ||
|
|
43
|
-
msg.includes("unauthorized") ||
|
|
44
|
-
msg.includes("credentials") ||
|
|
45
|
-
msg.includes("password") ||
|
|
46
|
-
msg.includes("login failed") ||
|
|
47
|
-
msg.includes("auth")) {
|
|
48
|
-
return {
|
|
49
|
-
exitCode: ExitCode.AUTH,
|
|
50
|
-
errorCode: ErrorCode.AUTH_FAILURE,
|
|
51
|
-
message: error.message,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
// Security violations
|
|
55
|
-
if (msg.includes("read-only") ||
|
|
56
|
-
msg.includes("readonly") ||
|
|
57
|
-
msg.includes("security") ||
|
|
58
|
-
msg.includes("forbidden") ||
|
|
59
|
-
msg.includes("blocked") ||
|
|
60
|
-
msg.includes("not allowed") ||
|
|
61
|
-
msg.includes("mutation")) {
|
|
62
|
-
return {
|
|
63
|
-
exitCode: ExitCode.SECURITY,
|
|
64
|
-
errorCode: ErrorCode.SECURITY_VIOLATION,
|
|
65
|
-
message: error.message,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
// SQL / query execution errors
|
|
69
|
-
if (msg.includes("sql") ||
|
|
70
|
-
msg.includes("query") ||
|
|
71
|
-
msg.includes("sqlcode") ||
|
|
72
|
-
msg.includes("sqlstate") ||
|
|
73
|
-
msg.includes("execute") ||
|
|
74
|
-
msg.includes("syntax error")) {
|
|
75
|
-
return {
|
|
76
|
-
exitCode: ExitCode.QUERY,
|
|
77
|
-
errorCode: ErrorCode.SQL_ERROR,
|
|
78
|
-
message: error.message,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
// Connection errors
|
|
82
|
-
if (msg.includes("connect") ||
|
|
83
|
-
msg.includes("econnrefused") ||
|
|
84
|
-
msg.includes("enotfound") ||
|
|
85
|
-
msg.includes("timeout") ||
|
|
86
|
-
msg.includes("timed out") ||
|
|
87
|
-
msg.includes("socket")) {
|
|
88
|
-
return {
|
|
89
|
-
exitCode: ExitCode.GENERAL,
|
|
90
|
-
errorCode: ErrorCode.CONNECTION_ERROR,
|
|
91
|
-
message: error.message,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
// Not found
|
|
95
|
-
if (msg.includes("not found") ||
|
|
96
|
-
msg.includes("does not exist") ||
|
|
97
|
-
msg.includes("no such")) {
|
|
98
|
-
return {
|
|
99
|
-
exitCode: ExitCode.GENERAL,
|
|
100
|
-
errorCode: ErrorCode.NOT_FOUND,
|
|
101
|
-
message: error.message,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
// Default: general error
|
|
105
|
-
return {
|
|
106
|
-
exitCode: ExitCode.GENERAL,
|
|
107
|
-
errorCode: ErrorCode.GENERAL_ERROR,
|
|
108
|
-
message: error.message,
|
|
109
|
-
};
|
|
110
|
-
}
|
|
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ACzB,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,EACtB,CAAC;QACD,OAAO;YACL,QAAQ,EAAE,QAAQ,CAAC,OAAO;YAC1B,SAAS,EAAE,SAAS,CAAC,gBAAgB;YACrC,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC;IACJ,CAAC;IAED,YAAY;IACZ,IACE,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC;QACzB,GAAG,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QAC9B,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,EACvB,CAAC;QACD,OAAO;YACL,QAAQ,EAAE,QAAQ,CAAC,OAAO;YAC1B,SAAS,EAAE,SAAS,CAAC,SAAS;YAC9B,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC;IACJ,CAAC;IAED,yBAAyB;IACzB,OAAO;QACL,QAAQ,EAAE,QAAQ,CAAC,OAAO;QAC1B,SAAS,EAAE,SAAS,CAAC,aAAa;QAClC,OAAO,EAAE,KAAK,CAAC,OAAO;KACvB,CAAC;AACJ,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Multi-system parallel execution for the IBM i CLI.
|
|
3
|
-
* Creates a temporary SourceManager to run queries against multiple
|
|
4
|
-
* systems in parallel using independent connection pools.
|
|
5
|
-
* @module cli/utils/multi-connection
|
|
6
|
-
*/
|
|
7
|
-
import type { ResolvedSystem } from "../config/types.js";
|
|
8
|
-
import type { RequestContext } from "../../utils/internal/requestContext.js";
|
|
9
|
-
import { type CommandResult } from "./command-helpers.js";
|
|
10
|
-
/** Result from a single system in a multi-system execution. */
|
|
11
|
-
export interface MultiSystemResult {
|
|
12
|
-
system: string;
|
|
13
|
-
host: string;
|
|
14
|
-
data: Record<string, unknown>[];
|
|
15
|
-
rowCount: number;
|
|
16
|
-
elapsedMs: number;
|
|
17
|
-
error?: string;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Execute an action against multiple systems in parallel using SourceManager.
|
|
21
|
-
*
|
|
22
|
-
* Creates a temporary SourceManager instance with one pool per system,
|
|
23
|
-
* fans out the action via Promise.allSettled, and cleans up all pools.
|
|
24
|
-
*/
|
|
25
|
-
export declare function executeMultiSystem(systems: ResolvedSystem[], action: (sourceName: string, mgr: InstanceType<typeof import("../../ibmi-mcp-server/services/sourceManager.js").SourceManager>, ctx: RequestContext) => Promise<CommandResult>): Promise<MultiSystemResult[]>;
|
|
26
|
-
//# sourceMappingURL=multi-connection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multi-connection.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/multi-connection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAE7E,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE5E,+DAA+D;AAC/D,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,cAAc,EAAE,EACzB,MAAM,EAAE,CACN,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,YAAY,CAAC,cAAc,iDAAiD,EAAE,aAAa,CAAC,EACjG,GAAG,EAAE,cAAc,KAChB,OAAO,CAAC,aAAa,CAAC,GAC1B,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAsE9B"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Multi-system parallel execution for the IBM i CLI.
|
|
3
|
-
* Creates a temporary SourceManager to run queries against multiple
|
|
4
|
-
* systems in parallel using independent connection pools.
|
|
5
|
-
* @module cli/utils/multi-connection
|
|
6
|
-
*/
|
|
7
|
-
import { resolvePassword } from "../config/credentials.js";
|
|
8
|
-
import { createCliContext } from "./command-helpers.js";
|
|
9
|
-
/**
|
|
10
|
-
* Execute an action against multiple systems in parallel using SourceManager.
|
|
11
|
-
*
|
|
12
|
-
* Creates a temporary SourceManager instance with one pool per system,
|
|
13
|
-
* fans out the action via Promise.allSettled, and cleans up all pools.
|
|
14
|
-
*/
|
|
15
|
-
export async function executeMultiSystem(systems, action) {
|
|
16
|
-
// Dynamic import to avoid pulling server modules into static CLI chain
|
|
17
|
-
const { SourceManager } = await import("../../ibmi-mcp-server/services/sourceManager.js");
|
|
18
|
-
// Resolve passwords upfront (sequentially — interactive prompts can't interleave)
|
|
19
|
-
const credentials = new Map();
|
|
20
|
-
for (const sys of systems) {
|
|
21
|
-
const password = await resolvePassword(sys.name, sys.config.password, sys.config.user, sys.config.host);
|
|
22
|
-
credentials.set(sys.name, password);
|
|
23
|
-
}
|
|
24
|
-
// Create a temporary SourceManager (not the singleton)
|
|
25
|
-
const mgr = new SourceManager();
|
|
26
|
-
try {
|
|
27
|
-
// Register each system as a named source
|
|
28
|
-
for (const sys of systems) {
|
|
29
|
-
await mgr.registerSource(sys.name, {
|
|
30
|
-
host: sys.config.host,
|
|
31
|
-
user: sys.config.user,
|
|
32
|
-
password: credentials.get(sys.name),
|
|
33
|
-
port: sys.config.port,
|
|
34
|
-
"ignore-unauthorized": sys.config.ignoreUnauthorized,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
// Fan out in parallel
|
|
38
|
-
const settled = await Promise.allSettled(systems.map(async (sys) => {
|
|
39
|
-
const ctx = createCliContext(`multi_sql_${sys.name}`);
|
|
40
|
-
const startTime = Date.now();
|
|
41
|
-
const result = await action(sys.name, mgr, ctx);
|
|
42
|
-
return {
|
|
43
|
-
system: sys.name,
|
|
44
|
-
host: sys.config.host,
|
|
45
|
-
data: result.data,
|
|
46
|
-
rowCount: result.data.length,
|
|
47
|
-
elapsedMs: Date.now() - startTime,
|
|
48
|
-
};
|
|
49
|
-
}));
|
|
50
|
-
// Map settled results
|
|
51
|
-
return settled.map((outcome, i) => {
|
|
52
|
-
if (outcome.status === "fulfilled") {
|
|
53
|
-
return outcome.value;
|
|
54
|
-
}
|
|
55
|
-
const sys = systems[i];
|
|
56
|
-
return {
|
|
57
|
-
system: sys.name,
|
|
58
|
-
host: sys.config.host,
|
|
59
|
-
data: [],
|
|
60
|
-
rowCount: 0,
|
|
61
|
-
elapsedMs: 0,
|
|
62
|
-
error: outcome.reason instanceof Error
|
|
63
|
-
? outcome.reason.message
|
|
64
|
-
: String(outcome.reason),
|
|
65
|
-
};
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
finally {
|
|
69
|
-
await mgr.closeAllSources();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=multi-connection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multi-connection.js","sourceRoot":"","sources":["../../../src/cli/utils/multi-connection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAsB,MAAM,sBAAsB,CAAC;AAY5E;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAAyB,EACzB,MAI2B;IAE3B,uEAAuE;IACvE,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CACpC,iDAAiD,CAClD,CAAC;IAEF,kFAAkF;IAClF,MAAM,WAAW,GAAwB,IAAI,GAAG,EAAE,CAAC;IACnD,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;QAC1B,MAAM,QAAQ,GA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I;gBACjB,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM;gBAC5B,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;aACN,CAAC;QAChC,CAAC,CAAC,CACH,CAAC;QAEF,sBAAsB;QACtB,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE;YAChC,IAAI,OAAO,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;gBACnC,OAAO,OAAO,CAAC,KAAK,CAAC;YACvB,CAAC;YACD,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAE,CAAC;YACxB,OAAO;gBACL,MAAM,EAAE,GAAG,CAAC,IAAI;gBAChB,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI;gBACrB,IAAI,EAAE,EAAE;gBACR,QAAQ,EAAE,CAAC;gBACX,SAAS,EAAE,CAAC;gBACZ,KAAK,EACH,OAAO,CAAC,MAAM,YAAY,KAAK;oBAC7B,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO;oBACxB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;aAC7B,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;YAAS,CAAC;QACT,MAAM,GAAG,CAAC,eAAe,EAAE,CAAC;IAC9B,CAAC;AACH,CAAC"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Lightweight YAML tool configuration loader for CLI.
|
|
3
|
-
* Reads and parses YAML tool files without pulling in the full MCP server stack.
|
|
4
|
-
* Used by discovery commands (ibmi tools, ibmi toolsets) and tool execution.
|
|
5
|
-
* @module cli/utils/yaml-loader
|
|
6
|
-
*/
|
|
7
|
-
/** Parameter definition from a YAML tool config. */
|
|
8
|
-
export interface YamlToolParameter {
|
|
9
|
-
name: string;
|
|
10
|
-
type: "string" | "boolean" | "integer" | "float" | "array";
|
|
11
|
-
description?: string;
|
|
12
|
-
required?: boolean;
|
|
13
|
-
default?: string | number | boolean | unknown[] | null;
|
|
14
|
-
enum?: Array<string | number | boolean>;
|
|
15
|
-
itemType?: "string" | "boolean" | "integer" | "float";
|
|
16
|
-
min?: number;
|
|
17
|
-
max?: number;
|
|
18
|
-
minLength?: number;
|
|
19
|
-
maxLength?: number;
|
|
20
|
-
pattern?: string;
|
|
21
|
-
}
|
|
22
|
-
/** Security config from a YAML tool. */
|
|
23
|
-
export interface YamlToolSecurity {
|
|
24
|
-
readOnly?: boolean;
|
|
25
|
-
maxQueryLength?: number;
|
|
26
|
-
forbiddenKeywords?: string[];
|
|
27
|
-
}
|
|
28
|
-
/** A single tool definition loaded from YAML. */
|
|
29
|
-
export interface YamlToolConfig {
|
|
30
|
-
source: string;
|
|
31
|
-
description: string;
|
|
32
|
-
statement?: string;
|
|
33
|
-
parameters: YamlToolParameter[];
|
|
34
|
-
security?: YamlToolSecurity;
|
|
35
|
-
responseFormat?: string;
|
|
36
|
-
tableFormat?: string;
|
|
37
|
-
maxDisplayRows?: number;
|
|
38
|
-
enabled?: boolean;
|
|
39
|
-
annotations?: Record<string, unknown>;
|
|
40
|
-
}
|
|
41
|
-
/** Toolset definition from YAML. */
|
|
42
|
-
export interface YamlToolsetConfig {
|
|
43
|
-
title?: string;
|
|
44
|
-
description?: string;
|
|
45
|
-
tools: string[];
|
|
46
|
-
}
|
|
47
|
-
/** Complete YAML tools configuration. */
|
|
48
|
-
export interface YamlToolsConfig {
|
|
49
|
-
tools: Record<string, YamlToolConfig>;
|
|
50
|
-
toolsets: Record<string, YamlToolsetConfig>;
|
|
51
|
-
sources: Record<string, Record<string, unknown>>;
|
|
52
|
-
metadata?: Record<string, unknown>;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Load and parse a single YAML tool file.
|
|
56
|
-
* Performs env var interpolation but no Zod validation (lightweight).
|
|
57
|
-
*/
|
|
58
|
-
export declare function loadYamlFile(filePath: string): YamlToolsConfig;
|
|
59
|
-
/**
|
|
60
|
-
* Load YAML tools from one or more paths.
|
|
61
|
-
* Accepts file paths, directories (scans for *.yaml/*.yml), or comma-separated lists.
|
|
62
|
-
* Merges all configs together, with later files overriding earlier ones.
|
|
63
|
-
*/
|
|
64
|
-
export declare function loadYamlTools(paths: string[]): YamlToolsConfig;
|
|
65
|
-
/**
|
|
66
|
-
* Build a reverse map from tool name → toolset names.
|
|
67
|
-
*/
|
|
68
|
-
export declare function buildToolsetMap(toolsets: Record<string, YamlToolsetConfig>): Map<string, string[]>;
|
|
69
|
-
//# sourceMappingURL=yaml-loader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"yaml-loader.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/yaml-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,oDAAoD;AACpD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC;IACvD,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IACtD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wCAAwC;AACxC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACn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