Class McpAppHarnessSession

Namespace
Kuestenlogik.Bowire.Endpoints
Assembly
Kuestenlogik.Bowire.dll

One run of an app in the harness: its spec and what was exchanged.

public sealed class McpAppHarnessSession
Inheritance
McpAppHarnessSession
Inherited Members

Properties

Created

When it was opened.

public DateTimeOffset Created { get; }

Property Value

DateTimeOffset

Id

The session's id.

public string Id { get; }

Property Value

string

Spec

What the harness runs: tool, serverUrl, arguments, result, replay.

public JsonObject Spec { get; }

Property Value

JsonObject

Methods

Add(JsonObject)

Record an event of the harness: { kind: "message", direction: "in" | "out", at, message }, { kind: "status", status } or { kind: "error", error }.

public void Add(JsonObject evt)

Parameters

evt JsonObject

ExpectAsync(string, JsonNode?, TimeSpan?, TimeSpan, CancellationToken)

#1112 — as ExpectAsync(string, JsonNode?, TimeSpan, CancellationToken), but timeout counts from the app's first message: the wait for the app to come up (a browser to start, its page to load) is bounded by startTimeout instead, so a slow start does not eat the app's own time. Null starts the window at once. The outcome says in started whether the app sent anything.

public Task<JsonObject> ExpectAsync(string method, JsonNode? expectedParams, TimeSpan? startTimeout, TimeSpan timeout, CancellationToken ct)

Parameters

method string
expectedParams JsonNode
startTimeout TimeSpan?
timeout TimeSpan
ct CancellationToken

Returns

Task<JsonObject>

ExpectAsync(string, JsonNode?, TimeSpan, CancellationToken)

Wait until the app sends a message with method whose params contain expectedParams, the harness reports an error, or timeout passes. The wait is a handshake on each arriving event; the timeout only bounds an app that never sends it.

public Task<JsonObject> ExpectAsync(string method, JsonNode? expectedParams, TimeSpan timeout, CancellationToken ct)

Parameters

method string
expectedParams JsonNode
timeout TimeSpan
ct CancellationToken

Returns

Task<JsonObject>

Snapshot()

Every event so far, as a JSON array.

public JsonArray Snapshot()

Returns

JsonArray