mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-10-25 16:20:01 +00:00
Fix mcp run script arg handling
This commit is contained in:
2 files changed
+12
-3
No files matched your search
@@ -123,6 +123,14 @@ public interface McpToolHandler
|
||||
return b;
|
||||
}
|
||||
|
||||
public Optional<FilePath> getOptionalFilePath(ShellControl sc, String key) throws Exception {
|
||||
if (getOptionalStringArgument(key).isEmpty()) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
return Optional.of(getFilePath(sc, key));
|
||||
}
|
||||
|
||||
public FilePath getFilePath(ShellControl sc, String key) throws Exception {
|
||||
var s = getStringArgument(key);
|
||||
var path = FilePath.parse(s);
|
||||
|
||||
@@ -434,12 +434,13 @@ public final class McpTools {
|
||||
.tool(tool)
|
||||
.callHandler(McpToolHandler.of((req) -> {
|
||||
var system = req.getStringArgument("system");
|
||||
var script = req.getDataStoreRef("script");
|
||||
var arguments = req.getStringArgument("arguments");
|
||||
var script = req.getDataStoreRef(req.getStringArgument("script"));
|
||||
var arguments = req.getOptionalStringArgument("arguments").orElse(null);
|
||||
|
||||
var shellStore = req.getShellStoreRef(system, true);
|
||||
var shellSession = AppBeaconServer.get().getCache().getOrStart(shellStore);
|
||||
var directory = req.getFilePath(shellSession.getControl(), "directory");
|
||||
var directory = req.getOptionalFilePath(shellSession.getControl(), "directory")
|
||||
.orElse(null);
|
||||
|
||||
var clazz = Class.forName(
|
||||
AppExtensionManager.getInstance()
|
||||
|
||||
Reference in new issue
Block a user