Skip to content

Packages  ›  trotsky  ›  StepBuilder

StepBuilder class

Represents a builder for a sequence of steps. This class is used internally by the Trotsky framework.

Signature:

typescript
export declare abstract class StepBuilder

Constructors

Constructor

Modifiers

Description

(constructor)(agent)

Initializes a new StepBuilder instance.

Properties

Property

Modifiers

Type

Description

agent

readonly

AtpAgent

Retrieves the current instance.

flattenSteps

readonly

Step[]

Retrieves a flattened list of all steps, including nested ones.

isTrotsky

readonly

boolean

Checks if this is a top-level Trotsky instance.

steps

readonly

Step[]

Retrieves all steps in the sequence.

Methods

Method

Modifiers

Description

append(type, args)

Appends a new step to the sequence.

applyAll()

Applies all steps in the sequence.

clear()

Clears all steps from the sequence.

clone(rest)

Clones the current instance, including all steps and configuration.

config(key)

Retreive the configuration value for a given key.

config(key, value)

Updates the configuration value for a given key.

config(config)

Updates the configuration object.

push(steps)

Pushes a step to the sequence.

run()

Runs the sequence of steps, returning the top-level StepBuilder instance.

runAll()

Runs all steps in the sequence.

schedule(expression)

Schedules the sequence to run at a given interval.

slice(stepOrIndex)

Adds a step to the sequence.

withAgent(agent)

Updates the agent instance.