mage-remote-run 1.4.0 → 1.6.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/bin/mage-remote-run.js +8 -1
- package/lib/config.js +1 -1
- package/lib/mcp.js +7 -3
- package/package.json +1 -1
package/bin/mage-remote-run.js
CHANGED
|
@@ -47,6 +47,8 @@ import { startMcpServer } from '../lib/mcp.js';
|
|
|
47
47
|
import { PluginLoader } from '../lib/plugin-loader.js';
|
|
48
48
|
import { eventBus, events } from '../lib/events.js';
|
|
49
49
|
import { createClient } from '../lib/api/factory.js';
|
|
50
|
+
import * as utils from '../lib/utils.js';
|
|
51
|
+
import * as commandHelper from '../lib/command-helper.js';
|
|
50
52
|
|
|
51
53
|
// Connection commands are registered dynamically via registerCommands
|
|
52
54
|
// But we need them registered early if we want them to show up in help even if config fails?
|
|
@@ -84,7 +86,12 @@ const appContext = {
|
|
|
84
86
|
profile,
|
|
85
87
|
eventBus,
|
|
86
88
|
events,
|
|
87
|
-
createClient
|
|
89
|
+
createClient,
|
|
90
|
+
lib: {
|
|
91
|
+
utils,
|
|
92
|
+
commandHelper,
|
|
93
|
+
config: { loadConfig, saveConfig },
|
|
94
|
+
},
|
|
88
95
|
};
|
|
89
96
|
|
|
90
97
|
const pluginLoader = new PluginLoader(appContext);
|
package/lib/config.js
CHANGED
|
@@ -42,7 +42,7 @@ export async function loadConfig() {
|
|
|
42
42
|
try {
|
|
43
43
|
await migrateOldConfig();
|
|
44
44
|
if (!fs.existsSync(CONFIG_FILE)) {
|
|
45
|
-
return { profiles: {}, activeProfile: null, plugins: [] };
|
|
45
|
+
return { $schema: "https://mage-remote-run.muench.dev/config.schema.json", profiles: {}, activeProfile: null, plugins: [] };
|
|
46
46
|
}
|
|
47
47
|
const data = fs.readFileSync(CONFIG_FILE, 'utf-8');
|
|
48
48
|
const config = JSON.parse(data);
|
package/lib/mcp.js
CHANGED
|
@@ -345,7 +345,11 @@ function registerTools(server, program, options = {}) {
|
|
|
345
345
|
const name = opt.name();
|
|
346
346
|
|
|
347
347
|
if (opt.flags.includes('<')) {
|
|
348
|
-
|
|
348
|
+
if (opt.flags.includes('<number>')) {
|
|
349
|
+
zodShape[name] = z.number().int().optional().describe(opt.description);
|
|
350
|
+
} else {
|
|
351
|
+
zodShape[name] = z.string().optional().describe(opt.description);
|
|
352
|
+
}
|
|
349
353
|
} else {
|
|
350
354
|
zodShape[name] = z.boolean().optional().describe(opt.description);
|
|
351
355
|
}
|
|
@@ -447,9 +451,9 @@ async function executeCommand(cmdDefinition, args, commandSegments) {
|
|
|
447
451
|
if (args[name] !== undefined) {
|
|
448
452
|
const val = args[name];
|
|
449
453
|
if (opt.flags.includes('<')) {
|
|
450
|
-
// String option
|
|
454
|
+
// String/number option
|
|
451
455
|
argv.push(`--${name}`);
|
|
452
|
-
argv.push(val);
|
|
456
|
+
argv.push(String(val));
|
|
453
457
|
} else {
|
|
454
458
|
// Boolean flag
|
|
455
459
|
if (val === true) {
|