using ScadaLink.Commons.Types;
namespace ScadaLink.CentralUI.ScriptAnalysis;
///
/// Runtime globals for an inbound API method Test Run. Mirrors
/// 's public surface so the same user code that
/// compiles for diagnostics also compiles against this type — but every
/// Route accessor throws instead of
/// reaching a deployed site. Cross-site routing needs the cluster transport and
/// a live instance, neither of which exists in a central Test Run; pure logic
/// and Parameters still work, matching how
/// throws on Attributes for shared scripts.
///
public class SandboxInboundScriptHost
{
/// Gets or initializes the script input parameters.
public ScriptParameters Parameters { get; init; } = new();
/// Gets or initializes the cancellation token for the test run.
public CancellationToken CancellationToken { get; init; }
/// Gets the route accessor; every call throws in a test run.
public RouteAccessor Route { get; } = new();
/// Mirror of ScadaLink.InboundAPI.RouteHelper.
public class RouteAccessor
{
///
/// Creates a sandbox route target that throws on every operation.
///
/// The instance code (used only in the exception message).
public RouteTarget To(string instanceCode) => new(instanceCode);
}
/// Mirror of ScadaLink.InboundAPI.RouteTarget — every call throws.
public class RouteTarget
{
private readonly string _instanceCode;
///
/// Initializes the sandbox route target for the given instance code.
///
/// The instance code referenced by the routing expression (used in the exception message).
internal RouteTarget(string instanceCode) => _instanceCode = instanceCode;
///
/// Always throws ; cross-site routing is unavailable in a Test Run.
///
/// Script name (included in the exception message).
/// Unused parameters.
/// Unused token.
public Task