feat: Remote-Execute für Linux/Bash – OS-basierte Tool-Descriptions und remote.sh Script
Remote-Verbindungen erkennen jetzt das OS des Clients und passen die Tool-Description dynamisch an (PowerShell für Windows, Bash für Linux). Neues remote.sh Script für Linux/macOS-Clients mit embedded Python WebSocket-Client. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
1035066a39
commit
53cee67bef
11 files changed
+381
-27
No files matched your search
+13
-4
@@ -21,6 +21,7 @@ public class ToolDefinitionOptions
|
||||
public bool IncludeMemory { get; set; }
|
||||
public bool IncludeUserChoice { get; set; } = true;
|
||||
public bool IncludeRemote { get; set; }
|
||||
public string RemoteOs { get; set; }
|
||||
public bool IncludeMemorySearch { get; set; }
|
||||
public bool IncludeSendToSession { get; set; }
|
||||
public bool IncludeGitHubSearch { get; set; }
|
||||
@@ -106,7 +107,7 @@ public class ToolService
|
||||
if (opts.IncludeMemorySearch)
|
||||
allTools.Add(GetMemorySearchTool());
|
||||
if (opts.IncludeRemote)
|
||||
allTools.Add(GetRemoteExecuteTool());
|
||||
allTools.Add(GetRemoteExecuteTool(opts.RemoteOs));
|
||||
if (opts.IncludeSendToSession)
|
||||
allTools.Add(GetSendToSessionTool());
|
||||
if (opts.IncludeGitHubSearch)
|
||||
@@ -352,18 +353,26 @@ public class ToolService
|
||||
};
|
||||
}
|
||||
|
||||
private object GetRemoteExecuteTool()
|
||||
private object GetRemoteExecuteTool(string remoteOs = null)
|
||||
{
|
||||
var isLinux = (remoteOs ?? "").Contains("Linux", StringComparison.OrdinalIgnoreCase);
|
||||
var desc = isLinux
|
||||
? "Führt einen Bash-Befehl auf der verbundenen Remote-Linux-Workstation aus. Gibt stdout und stderr zurück. Nutze dies für Diagnose und Administration des Remote-PCs (z.B. Netzwerk, Services, Logs, Pakete). Timeout: 180 Sekunden."
|
||||
: "Führt einen PowerShell-Befehl auf der verbundenen Remote-Windows-Workstation aus. Gibt stdout und stderr zurück. Nutze dies für Diagnose und Administration des Remote-PCs (z.B. Druckerprobleme, Netzwerk, Services, Registry). Timeout: 180 Sekunden.";
|
||||
var cmdDesc = isLinux
|
||||
? "Bash-Befehl zum Ausführen auf dem Remote-PC"
|
||||
: "PowerShell-Befehl zum Ausführen auf dem Remote-PC";
|
||||
|
||||
return new
|
||||
{
|
||||
name = "remote_execute",
|
||||
description = "Führt einen PowerShell-Befehl auf der verbundenen Remote-Windows-Workstation aus. Gibt stdout und stderr zurück. Nutze dies für Diagnose und Administration des Remote-PCs (z.B. Druckerprobleme, Netzwerk, Services, Registry). Timeout: 180 Sekunden.",
|
||||
description = desc,
|
||||
input_schema = new
|
||||
{
|
||||
type = "object",
|
||||
properties = new Dictionary<string, object>
|
||||
{
|
||||
["command"] = new { type = "string", description = "PowerShell-Befehl zum Ausführen auf dem Remote-PC" }
|
||||
["command"] = new { type = "string", description = cmdDesc }
|
||||
},
|
||||
required = new[] { "command" }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user