@ibm/ibmi-mcp-server 0.4.4 → 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/tools/generateSql.tool.d.ts +4 -0
- package/dist/ibmi-mcp-server/tools/generateSql.tool.d.ts.map +1 -1
- package/dist/ibmi-mcp-server/tools/generateSql.tool.js +1 -1
- package/dist/ibmi-mcp-server/tools/generateSql.tool.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 +23 -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 -246
- 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/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 -106
- 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 -26
- package/dist/cli/config/resolver.d.ts.map +0 -1
- package/dist/cli/config/resolver.js +0 -102
- 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 -60
- package/dist/cli/formatters/output.d.ts.map +0 -1
- package/dist/cli/formatters/output.js +0 -190
- 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 -100
- 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/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,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
|
-
}
|
|
111
|
-
//# sourceMappingURL=exit-codes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exit-codes.js","sourceRoot":"","sources":["../../../src/cli/utils/exit-codes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,qDAAqD;AACrD,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,sCAAsC;IACtC,OAAO,EAAE,CAAC;IACV,4DAA4D;IAC5D,OAAO,EAAE,CAAC;IACV,wCAAw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B,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,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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CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAED,oCAAoC;AACpC,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,yCAAyC;AACzC,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACtC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC5C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAWD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,CAgB9D;AA4BD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,eAAe,CAuB9D;AA0CD;;GAEG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAC1C,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAUvB"}
|
|
@@ -1,135 +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
|
-
import { readFileSync, existsSync, statSync, readdirSync } from "fs";
|
|
8
|
-
import { resolve, join } from "path";
|
|
9
|
-
import { load as yamlLoad } from "js-yaml";
|
|
10
|
-
/**
|
|
11
|
-
* Interpolate ${ENV_VAR} references in a string.
|
|
12
|
-
*/
|
|
13
|
-
function interpolateEnvVars(content) {
|
|
14
|
-
return content.replace(/\$\{([^}]+)\}/g, (_, varName) => {
|
|
15
|
-
return process.env[varName.trim()] ?? "";
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Load and parse a single YAML tool file.
|
|
20
|
-
* Performs env var interpolation but no Zod validation (lightweight).
|
|
21
|
-
*/
|
|
22
|
-
export function loadYamlFile(filePath) {
|
|
23
|
-
const resolved = resolve(filePath);
|
|
24
|
-
if (!existsSync(resolved)) {
|
|
25
|
-
throw new Error(`YAML tool file not found: ${resolved}`);
|
|
26
|
-
}
|
|
27
|
-
const content = readFileSync(resolved, "utf-8");
|
|
28
|
-
const interpolated = interpolateEnvVars(content);
|
|
29
|
-
const parsed = yamlLoad(interpolated);
|
|
30
|
-
return {
|
|
31
|
-
tools: normalizeTools(parsed["tools"]),
|
|
32
|
-
toolsets: (parsed["toolsets"] ?? {}),
|
|
33
|
-
sources: (parsed["sources"] ?? {}),
|
|
34
|
-
metadata: parsed["metadata"],
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Normalize raw tool entries to ensure parameters is always an array.
|
|
39
|
-
*/
|
|
40
|
-
function normalizeTools(raw) {
|
|
41
|
-
if (!raw)
|
|
42
|
-
return {};
|
|
43
|
-
const result = {};
|
|
44
|
-
for (const [name, value] of Object.entries(raw)) {
|
|
45
|
-
const tool = value;
|
|
46
|
-
result[name] = {
|
|
47
|
-
source: tool["source"] ?? "",
|
|
48
|
-
description: tool["description"] ?? "",
|
|
49
|
-
statement: tool["statement"],
|
|
50
|
-
parameters: Array.isArray(tool["parameters"]) ? tool["parameters"] : [],
|
|
51
|
-
security: tool["security"],
|
|
52
|
-
responseFormat: tool["responseFormat"],
|
|
53
|
-
tableFormat: tool["tableFormat"],
|
|
54
|
-
maxDisplayRows: tool["maxDisplayRows"],
|
|
55
|
-
enabled: tool["enabled"],
|
|
56
|
-
annotations: tool["annotations"],
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
return result;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Load YAML tools from one or more paths.
|
|
63
|
-
* Accepts file paths, directories (scans for *.yaml/*.yml), or comma-separated lists.
|
|
64
|
-
* Merges all configs together, with later files overriding earlier ones.
|
|
65
|
-
*/
|
|
66
|
-
export function loadYamlTools(paths) {
|
|
67
|
-
const merged = {
|
|
68
|
-
tools: {},
|
|
69
|
-
toolsets: {},
|
|
70
|
-
sources: {},
|
|
71
|
-
};
|
|
72
|
-
for (const p of paths) {
|
|
73
|
-
const resolved = resolve(p.trim());
|
|
74
|
-
const filePaths = resolveToFiles(resolved);
|
|
75
|
-
for (const filePath of filePaths) {
|
|
76
|
-
const config = loadYamlFile(filePath);
|
|
77
|
-
Object.assign(merged.tools, config.tools);
|
|
78
|
-
Object.assign(merged.toolsets, config.toolsets);
|
|
79
|
-
Object.assign(merged.sources, config.sources);
|
|
80
|
-
if (config.metadata) {
|
|
81
|
-
merged.metadata = { ...(merged.metadata ?? {}), ...config.metadata };
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return merged;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Resolve a path to a list of YAML files.
|
|
89
|
-
* If it's a file, returns [file]. If directory, scans for *.yaml/*.yml recursively.
|
|
90
|
-
*/
|
|
91
|
-
function resolveToFiles(p) {
|
|
92
|
-
if (!existsSync(p)) {
|
|
93
|
-
throw new Error(`Path not found: ${p}`);
|
|
94
|
-
}
|
|
95
|
-
const stat = statSync(p);
|
|
96
|
-
if (stat.isFile()) {
|
|
97
|
-
return [p];
|
|
98
|
-
}
|
|
99
|
-
if (stat.isDirectory()) {
|
|
100
|
-
return scanDirectory(p);
|
|
101
|
-
}
|
|
102
|
-
return [];
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Recursively scan a directory for YAML files.
|
|
106
|
-
*/
|
|
107
|
-
function scanDirectory(dir) {
|
|
108
|
-
const results = [];
|
|
109
|
-
const entries = readdirSync(dir, { withFileTypes: true });
|
|
110
|
-
for (const entry of entries) {
|
|
111
|
-
const fullPath = join(dir, entry.name);
|
|
112
|
-
if (entry.isDirectory()) {
|
|
113
|
-
results.push(...scanDirectory(fullPath));
|
|
114
|
-
}
|
|
115
|
-
else if (entry.isFile() && /\.ya?ml$/i.test(entry.name)) {
|
|
116
|
-
results.push(fullPath);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return results;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Build a reverse map from tool name → toolset names.
|
|
123
|
-
*/
|
|
124
|
-
export function buildToolsetMap(toolsets) {
|
|
125
|
-
const map = new Map();
|
|
126
|
-
for (const [tsName, tsConfig] of Object.entries(toolsets)) {
|
|
127
|
-
for (const toolName of tsConfig.tools) {
|
|
128
|
-
const existing = map.get(toolName) ?? [];
|
|
129
|
-
existing.push(tsName);
|
|
130
|
-
map.set(toolName, existing);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
return map;
|
|
134
|
-
}
|
|
135
|
-
//# sourceMappingURL=yaml-loader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"yaml-loader.js","sourceRoot":"","sources":["../../../src/cli/utils/yaml-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,SAAS,CAAC;AAsD3C;;GAEG;AACH,SAAS,kBAAkB,CAAC,OAAe;IACzC,OAAO,OAAO,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC,EAAE,OAAe,EAAE,EAAE;QAC9D,OA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,IAAI,CAAC,QAAQ,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,QAA2C;IAE3C,MAAM,GAAG,GAAG,IAAI,GAAG,EAAoB,CAAC;IACxC,KAAK,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1D,KAAK,MAAM,QAAQ,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YACtC,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACzC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACtB,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Maps YAML tool parameter definitions to Commander CLI options.
|
|
3
|
-
* Handles snake_case → kebab-case conversion, type coercion, and reverse mapping.
|
|
4
|
-
* @module cli/utils/yaml-to-commander
|
|
5
|
-
*/
|
|
6
|
-
import { Command } from "commander";
|
|
7
|
-
import type { YamlToolParameter } from "./yaml-loader.js";
|
|
8
|
-
/**
|
|
9
|
-
* Register YAML tool parameters as Commander options on a Command.
|
|
10
|
-
* Each parameter becomes a typed CLI option with coercion and defaults.
|
|
11
|
-
*/
|
|
12
|
-
export declare function registerToolOptions(cmd: Command, params: YamlToolParameter[]): void;
|
|
13
|
-
/**
|
|
14
|
-
* Convert Commander options (camelCase from --kebab-case) back to
|
|
15
|
-
* snake_case parameter names for YAML tool execution.
|
|
16
|
-
*
|
|
17
|
-
* Commander converts --schema-name to opts.schemaName.
|
|
18
|
-
* This maps it back to { schema_name: value }.
|
|
19
|
-
*/
|
|
20
|
-
export declare function optsToParams(opts: Record<string, unknown>, params: YamlToolParameter[]): Record<string, unknown>;
|
|
21
|
-
/**
|
|
22
|
-
* Validate required parameters are present.
|
|
23
|
-
* Returns an array of missing required parameter names.
|
|
24
|
-
*/
|
|
25
|
-
export declare function validateRequiredParams(values: Record<string, unknown>, params: YamlToolParameter[]): string[];
|
|
26
|
-
//# sourceMappingURL=yaml-to-commander.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"yaml-to-commander.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/yaml-to-commander.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AA8C1D;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,iBAAiB,EAAE,GAC1B,IAAI,CA4CN;AA+BD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,MAAM,EAAE,iBAAiB,EAAE,GAC1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAczB;AASD;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,MAAM,EAAE,iBAAiB,EAAE,GAC1B,MAAM,EAAE,CAQV"}
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Maps YAML tool parameter definitions to Commander CLI options.
|
|
3
|
-
* Handles snake_case → kebab-case conversion, type coercion, and reverse mapping.
|
|
4
|
-
* @module cli/utils/yaml-to-commander
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Convert a snake_case parameter name to a --kebab-case CLI flag.
|
|
8
|
-
*
|
|
9
|
-
* Examples:
|
|
10
|
-
* schema_name → --schema-name <value>
|
|
11
|
-
* include_system → --include-system
|
|
12
|
-
* limit → --limit <n>
|
|
13
|
-
*/
|
|
14
|
-
function toOptionFlag(param) {
|
|
15
|
-
const kebab = param.name.replace(/_/g, "-");
|
|
16
|
-
if (param.type === "boolean") {
|
|
17
|
-
return `--${kebab}`;
|
|
18
|
-
}
|
|
19
|
-
return `--${kebab} <value>`;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Build a description string for a parameter, including enum/range hints.
|
|
23
|
-
*/
|
|
24
|
-
function buildDescription(param) {
|
|
25
|
-
const parts = [];
|
|
26
|
-
if (param.description) {
|
|
27
|
-
parts.push(param.description);
|
|
28
|
-
}
|
|
29
|
-
if (param.enum && param.enum.length > 0) {
|
|
30
|
-
const values = param.enum.map((v) => String(v)).join(", ");
|
|
31
|
-
parts.push(`choices: ${values}`);
|
|
32
|
-
}
|
|
33
|
-
if (param.min !== undefined || param.max !== undefined) {
|
|
34
|
-
const range = [
|
|
35
|
-
param.min !== undefined ? `min: ${param.min}` : null,
|
|
36
|
-
param.max !== undefined ? `max: ${param.max}` : null,
|
|
37
|
-
]
|
|
38
|
-
.filter(Boolean)
|
|
39
|
-
.join(", ");
|
|
40
|
-
parts.push(range);
|
|
41
|
-
}
|
|
42
|
-
return parts.join(". ") || param.name;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Register YAML tool parameters as Commander options on a Command.
|
|
46
|
-
* Each parameter becomes a typed CLI option with coercion and defaults.
|
|
47
|
-
*/
|
|
48
|
-
export function registerToolOptions(cmd, params) {
|
|
49
|
-
for (const param of params) {
|
|
50
|
-
const flag = toOptionFlag(param);
|
|
51
|
-
const desc = buildDescription(param);
|
|
52
|
-
switch (param.type) {
|
|
53
|
-
case "boolean":
|
|
54
|
-
cmd.option(flag, desc);
|
|
55
|
-
break;
|
|
56
|
-
case "integer":
|
|
57
|
-
if (param.default !== undefined) {
|
|
58
|
-
cmd.option(flag, desc, parseIntOption, param.default);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
cmd.option(flag, desc, parseIntOption);
|
|
62
|
-
}
|
|
63
|
-
break;
|
|
64
|
-
case "float":
|
|
65
|
-
if (param.default !== undefined) {
|
|
66
|
-
cmd.option(flag, desc, parseFloatOption, param.default);
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
cmd.option(flag, desc, parseFloatOption);
|
|
70
|
-
}
|
|
71
|
-
break;
|
|
72
|
-
case "array":
|
|
73
|
-
if (param.default !== undefined) {
|
|
74
|
-
cmd.option(flag, desc, parseArrayOption, param.default);
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
cmd.option(flag, desc, parseArrayOption);
|
|
78
|
-
}
|
|
79
|
-
break;
|
|
80
|
-
default:
|
|
81
|
-
// string
|
|
82
|
-
if (param.default !== undefined) {
|
|
83
|
-
cmd.option(flag, desc, String(param.default));
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
cmd.option(flag, desc);
|
|
87
|
-
}
|
|
88
|
-
break;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Commander parse function for integer options.
|
|
94
|
-
*/
|
|
95
|
-
function parseIntOption(value) {
|
|
96
|
-
const parsed = parseInt(value, 10);
|
|
97
|
-
if (isNaN(parsed)) {
|
|
98
|
-
throw new Error(`Expected an integer but got: ${value}`);
|
|
99
|
-
}
|
|
100
|
-
return parsed;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Commander parse function for float options.
|
|
104
|
-
*/
|
|
105
|
-
function parseFloatOption(value) {
|
|
106
|
-
const parsed = parseFloat(value);
|
|
107
|
-
if (isNaN(parsed)) {
|
|
108
|
-
throw new Error(`Expected a number but got: ${value}`);
|
|
109
|
-
}
|
|
110
|
-
return parsed;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Commander parse function for array options (comma-separated).
|
|
114
|
-
*/
|
|
115
|
-
function parseArrayOption(value) {
|
|
116
|
-
return value.split(",").map((s) => s.trim());
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Convert Commander options (camelCase from --kebab-case) back to
|
|
120
|
-
* snake_case parameter names for YAML tool execution.
|
|
121
|
-
*
|
|
122
|
-
* Commander converts --schema-name to opts.schemaName.
|
|
123
|
-
* This maps it back to { schema_name: value }.
|
|
124
|
-
*/
|
|
125
|
-
export function optsToParams(opts, params) {
|
|
126
|
-
const result = {};
|
|
127
|
-
for (const param of params) {
|
|
128
|
-
// Commander converts --kebab-case → camelCase
|
|
129
|
-
const kebab = param.name.replace(/_/g, "-");
|
|
130
|
-
const camel = kebabToCamel(kebab);
|
|
131
|
-
if (opts[camel] !== undefined) {
|
|
132
|
-
result[param.name] = opts[camel];
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
return result;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Convert kebab-case to camelCase (matching Commander's behavior).
|
|
139
|
-
*/
|
|
140
|
-
function kebabToCamel(s) {
|
|
141
|
-
return s.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Validate required parameters are present.
|
|
145
|
-
* Returns an array of missing required parameter names.
|
|
146
|
-
*/
|
|
147
|
-
export function validateRequiredParams(values, params) {
|
|
148
|
-
const missing = [];
|
|
149
|
-
for (const param of params) {
|
|
150
|
-
if (param.required && param.default === undefined && values[param.name] === undefined) {
|
|
151
|
-
missing.push(param.name);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return missing;
|
|
155
|
-
}
|
|
156
|
-
//# sourceMappingURL=yaml-to-commander.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"yaml-to-commander.js","sourceRoot":"","sources":["../../../src/cli/utils/yaml-to-commander.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;;;;;;GAOG;AACH,S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