@alcyone-labs/arg-parser 2.4.0 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -0
- package/dist/core/ArgParser.d.ts.map +1 -1
- package/dist/core/ArgParserBase.d.ts.map +1 -1
- package/dist/index.cjs +11 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.min.mjs +10 -6
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +10 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -3
package/dist/index.mjs
CHANGED
|
@@ -19,7 +19,7 @@ import { createMcpLogger } from "@alcyone-labs/simple-mcp-logger";
|
|
|
19
19
|
import { Logger, createCliLogger, createMcpLogger as createMcpLogger2, logger } from "@alcyone-labs/simple-mcp-logger";
|
|
20
20
|
import process$1 from "node:process";
|
|
21
21
|
import { randomUUID } from "node:crypto";
|
|
22
|
-
import { URL as URL$1 } from "
|
|
22
|
+
import { URL as URL$1 } from "url";
|
|
23
23
|
const RESET$1 = "\x1B[0m";
|
|
24
24
|
const BOLD$1 = "\x1B[1m";
|
|
25
25
|
const DIM$1 = "\x1B[2m";
|
|
@@ -4611,7 +4611,7 @@ _handleMcpServeFlag_fn = async function(processArgs, _mcpServeIndex) {
|
|
|
4611
4611
|
debug.log("Transport options parsed:", JSON.stringify(transportOptions));
|
|
4612
4612
|
const mcpServerConfig = __privateMethod(this, _ArgParserBase_instances, _getMcpServerConfiguration_fn).call(this);
|
|
4613
4613
|
debug.log("Got MCP server config:", JSON.stringify(mcpServerConfig));
|
|
4614
|
-
const effectiveLogPath = transportOptions.logPath || (mcpServerConfig == null ? void 0 : mcpServerConfig.logPath) || "./logs/mcp.log";
|
|
4614
|
+
const effectiveLogPath = transportOptions.logPath || ((mcpServerConfig == null ? void 0 : mcpServerConfig.log) && typeof mcpServerConfig.log === "object" ? mcpServerConfig.log.logToFile : null) || (mcpServerConfig == null ? void 0 : mcpServerConfig.logPath) || "./logs/mcp.log";
|
|
4615
4615
|
debug.log("Effective log path:", effectiveLogPath);
|
|
4616
4616
|
const resolvedLogPath = resolveLogPath(effectiveLogPath);
|
|
4617
4617
|
debug.log("Resolved log path:", resolvedLogPath);
|
|
@@ -4701,7 +4701,7 @@ _handleMcpServeFlag_fn = async function(processArgs, _mcpServeIndex) {
|
|
|
4701
4701
|
/**
|
|
4702
4702
|
* Resolve logger configuration for MCP serve with proper priority
|
|
4703
4703
|
* @param mcpServerConfig MCP server configuration
|
|
4704
|
-
* @param resolvedLogPath Resolved log path from CLI flags
|
|
4704
|
+
* @param resolvedLogPath Resolved log path from CLI flags and config priority
|
|
4705
4705
|
* @returns Logger configuration object or string path
|
|
4706
4706
|
*/
|
|
4707
4707
|
_resolveLoggerConfigForServe_fn = function(mcpServerConfig, resolvedLogPath) {
|
|
@@ -4721,7 +4721,7 @@ _resolveLoggerConfigForServe_fn = function(mcpServerConfig, resolvedLogPath) {
|
|
|
4721
4721
|
// Default level for backward compatibility
|
|
4722
4722
|
mcpMode: true,
|
|
4723
4723
|
...mcpServerConfig.log,
|
|
4724
|
-
// Use
|
|
4724
|
+
// Use the resolved path which respects the proper priority order
|
|
4725
4725
|
logToFile: resolvedLogPath
|
|
4726
4726
|
};
|
|
4727
4727
|
}
|
|
@@ -6382,9 +6382,13 @@ Migration guide: https://github.com/alcyone-labs/arg-parser/blob/main/docs/MCP-M
|
|
|
6382
6382
|
});
|
|
6383
6383
|
const parsedArgs = (parsedResult == null ? void 0 : parsedResult.args) || parsedResult || {};
|
|
6384
6384
|
lifecycleManager.setParsedArgs(parsedArgs);
|
|
6385
|
-
logger2.mcpError(
|
|
6385
|
+
logger2.mcpError(
|
|
6386
|
+
`Lifecycle manager initialized with parsed args: ${Object.keys(parsedArgs).join(", ")}`
|
|
6387
|
+
);
|
|
6386
6388
|
} catch (parseError) {
|
|
6387
|
-
logger2.mcpError(
|
|
6389
|
+
logger2.mcpError(
|
|
6390
|
+
`Warning: Could not parse arguments for lifecycle manager: ${parseError instanceof Error ? parseError.message : String(parseError)}`
|
|
6391
|
+
);
|
|
6388
6392
|
}
|
|
6389
6393
|
const originalConnect = server.connect.bind(server);
|
|
6390
6394
|
server.connect = async (transport) => {
|