mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 07:00:43 +08:00
fix: supportedShellTools not right
This commit is contained in:
@@ -235,7 +235,10 @@ public class ServerFactory {
|
||||
}
|
||||
toolMappingBuilder.addShellClass(shellType, shellClass);
|
||||
}
|
||||
server.addToolMapping(shellTool, toolMappingBuilder.build());
|
||||
ToolMapping mapping = toolMappingBuilder.build();
|
||||
if (mapping.isNotEmpty()) {
|
||||
server.addToolMapping(shellTool, mapping);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,10 @@ public class ToolMapping {
|
||||
this.shellClassMap = new LinkedHashMap<>(shellClassMap);
|
||||
}
|
||||
|
||||
public boolean isNotEmpty() {
|
||||
return !shellClassMap.isEmpty();
|
||||
}
|
||||
|
||||
public Set<String> getSupportedShellTypes() {
|
||||
return shellClassMap.keySet();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user