Get the scenario run ID.
The scenario run ID
Get the associated devbox ID.
The devbox ID
Get the devbox instance for this scenario run.
This property provides lazy-loaded access to the devbox associated with this scenario run. Use this to interact with the devbox environment during the scenario execution.
The devbox instance
Get the complete scenario run data from the API.
Optionaloptions: RequestOptions<unknown>Request options
The scenario run data
Wait for the scenario environment (devbox) to be ready.
Blocks until the devbox reaches running state. Call this after using
scenario.runAsync() to ensure the devbox is ready for interaction.
Optionaloptions: RequestOptions<unknown> & { polling?: Partial<PollingOptions<DevboxView>> }Request options with optional polling configuration
The scenario run data after environment is ready
Submit the scenario run for scoring.
This triggers the scoring process using the scenario's scoring contract.
The scoring runs asynchronously; use awaitScored() or scoreAndAwait()
to wait for scoring to complete.
Optionaloptions: RequestOptions<unknown>Request options
The updated scenario run data
Wait for the scenario run to be scored.
Blocks until scoring is complete. Call this after score() to wait
for the scoring process to finish.
Optionaloptions: RequestOptions<unknown> & { polling?: Partial<PollingOptions<ScenarioRunView>> }Request options with optional polling configuration
The scored scenario run data
Submit for scoring and wait for completion.
This is a convenience method that combines score() and awaitScored().
Optionaloptions: RequestOptions<unknown> & { polling?: Partial<PollingOptions<ScenarioRunView>> }Request options with optional polling configuration
The scored scenario run data
Score the run, wait for scoring, then complete and shutdown.
This is a convenience method that scores the scenario run, waits for scoring to finish, then completes the run and shuts down the devbox. This is the recommended way to finish a scenario run.
Optionaloptions: RequestOptions<unknown> & { polling?: Partial<PollingOptions<ScenarioRunView>> }Request options with optional polling configuration
The completed scenario run data with scoring results
Complete the scenario run and shutdown the devbox.
Call this after scoring to finalize the run. The devbox will be
shut down and resources released. Note: The run must be in a
scored state before calling complete. Use cancel() to end a
run without scoring, or scoreAndComplete() to score and complete
in one operation.
Optionaloptions: RequestOptions<unknown>Request options
The final scenario run data
Cancel the scenario run and shutdown the devbox.
Use this to abort a running scenario. The devbox will be shut down and the run marked as canceled.
Optionaloptions: RequestOptions<unknown>Request options
The canceled scenario run data
Download all logs for this scenario run to a file.
Downloads a zip archive containing all logs from the scenario run's associated devbox. This is useful for debugging and analysis.
Path where the zip file will be written
Optionaloptions: RequestOptions<unknown>Request options
Get the scoring result for this run.
Returns null if the run has not been scored yet. Always makes an API call to retrieve the current scoring result.
Optionaloptions: RequestOptions<unknown>Request options
The scoring result or null if not yet scored
Object-oriented interface for working with Scenario Runs.
Remarks
Overview
The
ScenarioRunclass provides a high-level API for managing scenario runs. A scenario run represents a single execution of a scenario on a devbox, including the ability to interact with the devbox, score the run, and retrieve results.Quickstart
ScenarioRuns are typically obtained from a Scenario's
run()orrunAsync()methods: