ProtectedauthProtectedbrowserProtectedcancelledWhether Stop() has been called — checked at the top of each step and at the finer-grained checkpoints inside a step.
ProtectedjudgeProtectednavigationOptionalOnPer-run progress hook.
ProtectedtoolWhether the run has been stopped — by Stop or by its own expiry.
Exposed because "the engine stopped waiting" and "the engine stopped working" are different things: a step blocked in a page call keeps running after the run is scored, and this is what says whether it has been told to unwind at its next cooperative checkpoint.
ProtectedexecuteExecute the controller LLM prompt.
Base implementation: uses MJ AI Core BaseLLM provider directly via ClassFactory. Requires that an LLM provider is registered and that ControllerModel is set on params.
ProtectedexecuteExecute the judge LLM prompt.
Base implementation: uses MJ AI Core BaseLLM provider directly. Only called when the judge strategy involves an LLM (LLMJudge or HybridJudge when heuristics are inconclusive).
ProtectedhealSelf-heal a diverged replay step. Only selector drift is healable here: re-resolve the recorded target's role+name against a fresh element list, with ambiguous cases escalating to the healTargetViaLLM seam and low-confidence matches failing rather than guessing. On a confident match, execute the corrected action, verify the postcondition, rewrite the trace step's selector in place, and return true.
Flow drift (a failed postcondition) is not selector-healable and returns false, so the run falls back to the LLM tier.
ReplayHeal: 'off' skips all of this — the step diverges as recorded.
'deterministic' keeps the role+name re-resolution but never asks a model.
ProtectedhealFocused LLM disambiguation seam for a heal (leg 1b). Called ONLY
when the deterministic role+name re-resolution is ambiguous (multiple
candidates) or failed. A subclass with an LLM controller overrides this to
ask a cheap model "given these elements + this instruction, which index is
the intended target?" and return { index, confidence }. The base layer
has no model, so it returns confidence 0 (no disambiguation) — heal then
only succeeds on the deterministic path.
ProtectedlogProtectedlogOptionalerror: unknownProtectedonHook: called when the entire run completes. Override for cleanup, final persistence, or notifications.
ProtectedonHook: called after each step completes. Override for logging, persistence, or real-time monitoring.
Replay a recorded trace deterministically. Same browser lifecycle as Run, but each step is driven by the recorded trajectory instead of an LLM: settle → precondition (bounded wait for the target; fail the step on timeout — never proceed anyway) → locator-based action with Playwright auto-wait → postcondition assert. Consumes zero LLM budget.
The first step that can't be satisfied consults healReplayStep and,
if it can't heal, ends the run Failed with the divergence on
ComputerUseResult.Replay. Never throws, like Run.
Execute a complete Computer Use run: initialize the adapter, set up auth, navigate to the start URL, run the step loop, close the browser.
Never throws — all errors are caught and returned in ComputerUseResult.
Inject a pre-created browser adapter for shared session support. When set, the engine skips Launch()/Close() — the caller owns the lifecycle. Used by parallel test execution to share browser contexts across tests.
Inject a shared judge-verdict cache. When set, the engine reuses a cached verdict for an identical (goal, URL, visible-state) key instead of calling the LLM judge — the cross-attempt generalization of within-run gating. The driver owns the instance so verdicts survive attempt boundaries; unset → no cross-attempt caching (behavior unchanged).
Request cancellation of a running run. Cooperative: sets the flag the
engine's checkpoints observe AND aborts the shared signal so in-flight LLM
calls and settle/backoff delays return promptly. The run unwinds
to a Cancelled result within seconds — at the next checkpoint — rather
than running the current step to completion.
The default engine: a thin
ComputerUseEnginesubclass that forwards each completed step to ComputerUseGoalRun.OnProgress. It runs the real loop, so it requires a controller model — bindMJComputerUseEnginevia CdpRemoteBrowserSession.SetGoalEngineFactory in production for automatic vision-model selection through MJ metadata.