class

Anthropic::BetaEnvironmentWork

Inherits Reference < Object

Self-hosted environment work queue (beta).

These endpoints are called automatically by the pre-built environment worker for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.

Constructors

new(client : Client)
Source

Instance methods

ack(work_id : String, environment_id : String, betas : Array(String) = [] of String) : BetaSelfHostedWork

Acknowledge receipt of a work item, transitioning it from queued to starting and removing it from the queue

Source
heartbeat(work_id : String, environment_id : String, desired_ttl_seconds : Int32 | Nil = nil, expected_last_heartbeat : String | Nil = nil, betas : Array(String) = [] of String) : BetaSelfHostedWorkHeartbeatResponse

Record a heartbeat for a work item to maintain the lease

Source
list(environment_id : String, limit : Int32 = 20, page : String | Nil = nil, betas : Array(String) = [] of String) : BetaSelfHostedWorkListResponse

List work items in an environment

Source
poll(environment_id : String, block_ms : Int32 | Nil = nil, reclaim_older_than_ms : Int32 | Nil = nil, betas : Array(String) = [] of String, anthropic_worker_id : String | Nil = nil) : BetaSelfHostedWork | Nil

Long poll for work items in the queue. Returns nil when no work arrives before the poll window closes.

Source
retrieve(work_id : String, environment_id : String, betas : Array(String) = [] of String, workspace_id : String | Nil = nil) : BetaSelfHostedWork

Retrieve detailed information about a specific work item

Source
stats(environment_id : String, betas : Array(String) = [] of String, workspace_id : String | Nil = nil) : BetaSelfHostedWorkQueueStats

Get statistics about the work queue for an environment

Source
stop(work_id : String, environment_id : String, force : Bool | Nil = nil, betas : Array(String) = [] of String, workspace_id : String | Nil = nil) : BetaSelfHostedWork

Stop a work item, initiating graceful or forced shutdown

Source
update(work_id : String, environment_id : String, metadata : Hash(String, String | Nil), betas : Array(String) = [] of String, workspace_id : String | Nil = nil) : BetaSelfHostedWork

Update work item metadata with merge semantics.

Set a key to a string to upsert it, or to nil to delete it.

Source