@justanothermldude/mcp-exec 1.7.4 → 1.7.6
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/dist/codegen/wrapper-generator.js +2 -1
- package/dist/index.js +15 -4
- package/dist/tools/tool-catalog.js +12 -2
- package/package.json +1 -1
|
@@ -414,7 +414,8 @@ function generateMethodDefinition(tool, serverName, bridgePort) {
|
|
|
414
414
|
// Use escapeForTemplateLiteral to prevent backtick/`${}` injection in error messages
|
|
415
415
|
const tlSafe = (s) => escapeForTemplateLiteral(s);
|
|
416
416
|
lines.push(` if (!response.ok) {`);
|
|
417
|
-
lines.push(`
|
|
417
|
+
lines.push(` const errBody = await response.text().catch(() => '');`);
|
|
418
|
+
lines.push(` throw new Error(\`[${tlSafe(safeServerName)}.${tlSafe(safeToolName)}] HTTP \${response.status}: \${response.statusText}\${errBody ? ' — ' + errBody.slice(0, 500) : ''}\`);`);
|
|
418
419
|
lines.push(` }`);
|
|
419
420
|
lines.push(` const data = await response.json() as { success: boolean; content?: unknown; error?: string; isError?: boolean };`);
|
|
420
421
|
lines.push(` if (!data.success) {`);
|
package/dist/index.js
CHANGED
|
@@ -230,7 +230,12 @@ function compactTypeHint(propSchema) {
|
|
|
230
230
|
const keys = Object.keys(props);
|
|
231
231
|
if (keys.length === 0)
|
|
232
232
|
return "object";
|
|
233
|
-
const
|
|
233
|
+
const PRIM = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean"]);
|
|
234
|
+
const parts = keys.map((k) => {
|
|
235
|
+
const sub = props[k]?.type;
|
|
236
|
+
const sfx = required.includes(k) ? "" : "?";
|
|
237
|
+
return PRIM.has(sub ?? "") ? `${k}${sfx}:${sub}` : `${k}${sfx}`;
|
|
238
|
+
});
|
|
234
239
|
return `{${parts.join(", ")}}`;
|
|
235
240
|
}
|
|
236
241
|
if (type === "object") {
|
|
@@ -242,7 +247,12 @@ function compactTypeHint(propSchema) {
|
|
|
242
247
|
const props = items.properties;
|
|
243
248
|
const required = items.required || [];
|
|
244
249
|
const keys = Object.keys(props);
|
|
245
|
-
const
|
|
250
|
+
const PRIM = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean"]);
|
|
251
|
+
const parts = keys.map((k) => {
|
|
252
|
+
const sub = props[k]?.type;
|
|
253
|
+
const sfx = required.includes(k) ? "" : "?";
|
|
254
|
+
return PRIM.has(sub ?? "") ? `${k}${sfx}:${sub}` : `${k}${sfx}`;
|
|
255
|
+
});
|
|
246
256
|
return `[{${parts.join(", ")}}]`;
|
|
247
257
|
}
|
|
248
258
|
return null;
|
|
@@ -667,7 +677,8 @@ function generateMethodDefinition(tool, serverName, bridgePort) {
|
|
|
667
677
|
lines.push(` });`);
|
|
668
678
|
const tlSafe = /* @__PURE__ */ __name((s) => escapeForTemplateLiteral(s), "tlSafe");
|
|
669
679
|
lines.push(` if (!response.ok) {`);
|
|
670
|
-
lines.push(`
|
|
680
|
+
lines.push(` const errBody = await response.text().catch(() => '');`);
|
|
681
|
+
lines.push(` throw new Error(\`[${tlSafe(safeServerName)}.${tlSafe(safeToolName)}] HTTP \${response.status}: \${response.statusText}\${errBody ? ' \u2014 ' + errBody.slice(0, 500) : ''}\`);`);
|
|
671
682
|
lines.push(` }`);
|
|
672
683
|
lines.push(` const data = await response.json() as { success: boolean; content?: unknown; error?: string; isError?: boolean };`);
|
|
673
684
|
lines.push(` if (!data.success) {`);
|
|
@@ -1991,7 +2002,7 @@ __name(createMcpExecServer, "createMcpExecServer");
|
|
|
1991
2002
|
// dist/index.js
|
|
1992
2003
|
import { ServerPool, createConnection, getServerConfig as getServerConfig2, loadServerManifest as loadServerManifest2, cleanupOrphanedProcesses } from "@justanothermldude/meta-mcp-core";
|
|
1993
2004
|
var APP_NAME = "mcp-exec";
|
|
1994
|
-
var VERSION2 = "1.7.
|
|
2005
|
+
var VERSION2 = "1.7.5";
|
|
1995
2006
|
var defaultExecutor = null;
|
|
1996
2007
|
function getDefaultExecutor() {
|
|
1997
2008
|
if (!defaultExecutor) {
|
|
@@ -44,7 +44,12 @@ function compactTypeHint(propSchema) {
|
|
|
44
44
|
const keys = Object.keys(props);
|
|
45
45
|
if (keys.length === 0)
|
|
46
46
|
return 'object';
|
|
47
|
-
const
|
|
47
|
+
const PRIM = new Set(['string', 'number', 'integer', 'boolean']);
|
|
48
|
+
const parts = keys.map(k => {
|
|
49
|
+
const sub = props[k]?.type;
|
|
50
|
+
const sfx = required.includes(k) ? '' : '?';
|
|
51
|
+
return PRIM.has(sub ?? '') ? `${k}${sfx}:${sub}` : `${k}${sfx}`;
|
|
52
|
+
});
|
|
48
53
|
return `{${parts.join(', ')}}`;
|
|
49
54
|
}
|
|
50
55
|
// Freeform object — AI must call get_mcp_tool_schema before using
|
|
@@ -58,7 +63,12 @@ function compactTypeHint(propSchema) {
|
|
|
58
63
|
const props = items.properties;
|
|
59
64
|
const required = items.required || [];
|
|
60
65
|
const keys = Object.keys(props);
|
|
61
|
-
const
|
|
66
|
+
const PRIM = new Set(['string', 'number', 'integer', 'boolean']);
|
|
67
|
+
const parts = keys.map(k => {
|
|
68
|
+
const sub = props[k]?.type;
|
|
69
|
+
const sfx = required.includes(k) ? '' : '?';
|
|
70
|
+
return PRIM.has(sub ?? '') ? `${k}${sfx}:${sub}` : `${k}${sfx}`;
|
|
71
|
+
});
|
|
62
72
|
return `[{${parts.join(', ')}}]`;
|
|
63
73
|
}
|
|
64
74
|
// Simple typed arrays (string[], number[]) — usually obvious
|