Fremde Laufzeiten: Claude Code und Befehl in der Sandbox, Egress-Proxy, Vorschlag statt Einsatz (#712)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard
2026-09-25 22:46:49 +02:00
co-authored by Claude Opus 5.5
parent 7d6c2c9495
commit 367ea387f6
40 changed files with 3428 additions and 29 deletions
+9 -4
View File
@@ -5,7 +5,9 @@ namespace ClawdDotNet.Desktop;
/// <summary>
/// #713: <c>ClawdDotNet --mcp-bridge --instance &lt;dir&gt;</c> — the instance's MCP server
/// over stdio, for a runtime that starts its MCP servers as child processes.
/// over stdio, for a runtime that starts its MCP servers as child processes. In a sandbox
/// (#712), where there is no instance directory, <c>--socket &lt;path&gt;</c> names the
/// mounted MCP socket instead.
///
/// <para>No application is built here: no settings, no database, no engine. The bridge
/// only carries messages to the running instance over its MCP socket; everything is
@@ -19,10 +21,11 @@ internal static class McpBridgeRun
public static async Task<int> RunAsync(string[] args)
{
var socketPath = CommandLine.ReadValue(args, McpStdioBridge.SocketArgument);
var instancePath = CommandLine.ReadInstancePath(args);
if (string.IsNullOrWhiteSpace(instancePath) || !Directory.Exists(instancePath))
if (socketPath is null && (string.IsNullOrWhiteSpace(instancePath) || !Directory.Exists(instancePath)))
{
await Console.Error.WriteLineAsync($"Expected {CommandLine.InstanceArgument} <instance directory>.");
await Console.Error.WriteLineAsync($"Expected {CommandLine.InstanceArgument} <instance directory> or {McpStdioBridge.SocketArgument} <path>.");
return ExitNoInstance;
}
@@ -33,7 +36,9 @@ internal static class McpBridgeRun
return ExitNoToken;
}
using var client = InstanceEndpoint.CreateMcpClient(instancePath);
using var client = socketPath is not null
? InstanceEndpoint.CreateMcpClientForSocket(socketPath)
: InstanceEndpoint.CreateMcpClient(instancePath!);
using var stdin = new StreamReader(Console.OpenStandardInput());
await using var stdout = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };