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:
co-authored by
Claude Opus 5.5
parent
7d6c2c9495
commit
367ea387f6
@@ -5,7 +5,9 @@ namespace ClawdDotNet.Desktop;
|
||||
|
||||
/// <summary>
|
||||
/// #713: <c>ClawdDotNet --mcp-bridge --instance <dir></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 <path></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 };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user