metheus-governance-mcp-cli 0.2.33 → 0.2.34
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/cli.mjs +18 -0
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -4031,6 +4031,15 @@ async function runProxy(flags) {
|
|
|
4031
4031
|
timeoutSeconds: intFromRaw(flags["timeout-seconds"], 30),
|
|
4032
4032
|
};
|
|
4033
4033
|
const gatewayURL = buildGatewayURL(args);
|
|
4034
|
+
// Diagnostic: log workspace resolution context to file for debugging.
|
|
4035
|
+
try {
|
|
4036
|
+
const _diagDir = path.join(String(process.env.USERPROFILE || process.env.HOME || "."), ".metheus");
|
|
4037
|
+
fs.mkdirSync(_diagDir, { recursive: true });
|
|
4038
|
+
fs.appendFileSync(
|
|
4039
|
+
path.join(_diagDir, "mcp-proxy-diag.log"),
|
|
4040
|
+
`[${new Date().toISOString()}] boot: cwd=${process.cwd()} workspace-dir=${workspaceDirRaw} autoMode=${workspaceAutoMode} pinned=${pinnedWorkspaceDir || "(none)"} METHEUS_WORKSPACE_DIR=${process.env.METHEUS_WORKSPACE_DIR || "(unset)"}\n`,
|
|
4041
|
+
);
|
|
4042
|
+
} catch { /* best-effort */ }
|
|
4034
4043
|
let lastRefreshAttemptAtMs = 0;
|
|
4035
4044
|
let lastRefreshError = "";
|
|
4036
4045
|
let sessionWorkspaceDir = "";
|
|
@@ -4131,6 +4140,15 @@ async function runProxy(flags) {
|
|
|
4131
4140
|
requestObj,
|
|
4132
4141
|
toolArgs,
|
|
4133
4142
|
);
|
|
4143
|
+
if (isJsonRpcMethod(requestObj, "tools/call")) {
|
|
4144
|
+
try {
|
|
4145
|
+
const _diagDir = path.join(String(process.env.USERPROFILE || process.env.HOME || "."), ".metheus");
|
|
4146
|
+
fs.appendFileSync(
|
|
4147
|
+
path.join(_diagDir, "mcp-proxy-diag.log"),
|
|
4148
|
+
`[${new Date().toISOString()}] tools/call: tool=${toolName} sessionWS=${sessionWorkspaceDir} resolvedWS=${requestWorkspaceDir} trusted=${workspaceSignalTrusted} strongReq=${strongRequestWorkspaceCandidate || "(none)"} strongEnv=${strongEnvWorkspaceCandidate || "(none)"}\n`,
|
|
4149
|
+
);
|
|
4150
|
+
} catch { /* best-effort */ }
|
|
4151
|
+
}
|
|
4134
4152
|
let autoSyncSummary = null;
|
|
4135
4153
|
if (isJsonRpcMethod(requestObj, "tools/call")) {
|
|
4136
4154
|
autoSyncSummary = await maybeAutoSyncCtxpackForCall({
|