Table of Contents

Interface IStudioRecorderService

Namespace
Cress.Studio.Services
Assembly
Cress.Studio.Core.dll

Testability seam for the studio-side recording service. The real implementation wraps RecordingSession; tests substitute a mock.

public interface IStudioRecorderService

Properties

CapturedEventCount

Number of events captured in the active session so far.

int CapturedEventCount { get; }

Property Value

int

CurrentEvents

The raw events captured so far in the active session. Empty when not recording. Thread-safe snapshot on each access.

IReadOnlyList<RecordedEvent> CurrentEvents { get; }

Property Value

IReadOnlyList<RecordedEvent>

CurrentInferredSteps

Live inference applied to CurrentEvents. Recomputed on each StateChanged tick (~250 ms debounce). Empty when not recording.

IReadOnlyList<InferredStep> CurrentInferredSteps { get; }

Property Value

IReadOnlyList<InferredStep>

CurrentTarget

The target that is currently being (or was last) recorded.

RecordingTargetInfo? CurrentTarget { get; }

Property Value

RecordingTargetInfo

Elapsed

Elapsed time since recording started.

TimeSpan Elapsed { get; }

Property Value

TimeSpan

IsRecording

True while a recording session is active.

bool IsRecording { get; }

Property Value

bool

Methods

ListAvailableTargetsAsync()

Returns running processes that have a visible main window and can be attached to. Silently skips elevated/protected processes.

Task<IReadOnlyList<RecordingTargetInfo>> ListAvailableTargetsAsync()

Returns

Task<IReadOnlyList<RecordingTargetInfo>>

ReplayRecordedFlowAsync(string, string)

Loads the flow at flowFilePath and executes it in-process using the project rooted at projectPath. Returns pass/fail + step summary. Never spawns an external process.

Task<RecordingReplayResult> ReplayRecordedFlowAsync(string flowFilePath, string projectPath)

Parameters

flowFilePath string
projectPath string

Returns

Task<RecordingReplayResult>

StartRecordingAsync(int)

Attaches to processId and starts capturing events.

Task StartRecordingAsync(int processId)

Parameters

processId int

Returns

Task

StartWebRecordingAsync(string, string, CancellationToken)

Spawns the Node.js web recorder, opens a browser at url, and starts streaming web events.

Task StartWebRecordingAsync(string url, string browserType, CancellationToken ct = default)

Parameters

url string

Initial URL to navigate to (must be a valid absolute URL).

browserType string

Browser to launch: "chromium", "firefox", or "webkit".

ct CancellationToken

Optional cancellation token.

Returns

Task

StopRecordingAsync()

Stops the active session and returns the inferred steps plus raw events.

Task<RecordingResult> StopRecordingAsync()

Returns

Task<RecordingResult>

Events

StateChanged

Fires when recording state changes (start/stop/new event). Debounced to ~250 ms so rapid UIA event streams don't spam Blazor renders.

event Action? StateChanged

Event Type

Action