Skip to content

Commit e5df5ac

Browse files
authored
Merge pull request #4 from browserbase/release-please--branches--main--changes--next
release: 0.3.0
2 parents b90a630 + c8e16ec commit e5df5ac

72 files changed

Lines changed: 7305 additions & 1621 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.2.0"
2+
".": "0.3.0"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 7
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-705638ac8966569986bd9ebb7c9761bf0016909e9f2753e77ceabb12c8049511.yml
3-
openapi_spec_hash: a8fbbcaa38e91c7f97313620b42d8d62
4-
config_hash: a35b56eb05306a0f02e83c11d57f975f
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-e96507dd78e76fccc77ba7fb09704da127ead6f4d73ea854e9b2150e90787ff4.yml
3+
openapi_spec_hash: 0c2548b8fdd6de6789b19123e69609c1
4+
config_hash: c3abb41dbe698d59b3bf12f393013d54

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Changelog
22

3+
## 0.3.0 (2025-12-17)
4+
5+
Full Changelog: [v0.2.0...v0.3.0](https://github.com/browserbase/stagehand-ruby/compare/v0.2.0...v0.3.0)
6+
7+
### Features
8+
9+
* **api:** manual updates ([7dcf75c](https://github.com/browserbase/stagehand-ruby/commit/7dcf75cc0c580743b8bb0bbdb41077a6a7aa6dfb))
10+
* **api:** manual updates ([3162ca0](https://github.com/browserbase/stagehand-ruby/commit/3162ca00c75b37ccb869d7a082f25b263e15d93d))
11+
* **api:** manual updates ([a972ef7](https://github.com/browserbase/stagehand-ruby/commit/a972ef7dc9040af201ee8e87db013fc077a7ab3f))
12+
* **api:** manual updates ([be169eb](https://github.com/browserbase/stagehand-ruby/commit/be169ebb8a61b86f4d1caee63aeded39139f10aa))
13+
* **api:** manual updates ([2a98da9](https://github.com/browserbase/stagehand-ruby/commit/2a98da9563a1ab4e33d6bf3398083d772b61e07f))
14+
* **api:** manual updates ([05879da](https://github.com/browserbase/stagehand-ruby/commit/05879da16a92ae6199ca2c4e323a6602fbc5d841))
15+
* **api:** manual updates ([69e4183](https://github.com/browserbase/stagehand-ruby/commit/69e418398b943df8b7454b50ab02d17ba3feb212))
16+
* **api:** manual updates ([9176bca](https://github.com/browserbase/stagehand-ruby/commit/9176bcaf88f115335199a44a52c8e1d697920822))
17+
* **api:** manual updates ([36f0681](https://github.com/browserbase/stagehand-ruby/commit/36f0681452a11e25da7126e0270855bbdd3fe8df))
18+
19+
20+
### Bug Fixes
21+
22+
* calling `break` out of streams should be instantaneous ([369b9d0](https://github.com/browserbase/stagehand-ruby/commit/369b9d0d37390d96fa673d08e64594cefc6a04fa))
23+
324
## 0.2.0 (2025-12-16)
425

526
Full Changelog: [v0.1.0...v0.2.0](https://github.com/browserbase/stagehand-ruby/compare/v0.1.0...v0.2.0)

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GIT
1111
PATH
1212
remote: .
1313
specs:
14-
stagehand (0.2.0)
14+
stagehand (0.3.0)
1515
connection_pool
1616

1717
GEM

README.md

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
1717
<!-- x-release-please-start-version -->
1818

1919
```ruby
20-
gem "stagehand", "~> 0.2.0"
20+
gem "stagehand", "~> 0.3.0"
2121
```
2222

2323
<!-- x-release-please-end -->
@@ -36,7 +36,7 @@ stagehand = Stagehand::Client.new(
3636

3737
response = stagehand.sessions.act("00000000-your-session-id-000000000000", input: "click the first link on the page")
3838

39-
puts(response.actions)
39+
puts(response.data)
4040
```
4141

4242
### Handling errors
@@ -45,10 +45,7 @@ When the library is unable to connect to the API, or if the API returns a non-su
4545

4646
```ruby
4747
begin
48-
session = stagehand.sessions.start(
49-
browserbase_api_key: "your Browserbase API key",
50-
browserbase_project_id: "your Browserbase Project ID"
51-
)
48+
session = stagehand.sessions.start(model_name: "openai/gpt-5-nano")
5249
rescue Stagehand::Errors::APIConnectionError => e
5350
puts("The server could not be reached")
5451
puts(e.cause) # an underlying Exception, likely raised within `net/http`
@@ -91,11 +88,7 @@ stagehand = Stagehand::Client.new(
9188
)
9289

9390
# Or, configure per-request:
94-
stagehand.sessions.start(
95-
browserbase_api_key: "your Browserbase API key",
96-
browserbase_project_id: "your Browserbase Project ID",
97-
request_options: {max_retries: 5}
98-
)
91+
stagehand.sessions.start(model_name: "openai/gpt-5-nano", request_options: {max_retries: 5})
9992
```
10093

10194
### Timeouts
@@ -109,11 +102,7 @@ stagehand = Stagehand::Client.new(
109102
)
110103

111104
# Or, configure per-request:
112-
stagehand.sessions.start(
113-
browserbase_api_key: "your Browserbase API key",
114-
browserbase_project_id: "your Browserbase Project ID",
115-
request_options: {timeout: 5}
116-
)
105+
stagehand.sessions.start(model_name: "openai/gpt-5-nano", request_options: {timeout: 5})
117106
```
118107

119108
On timeout, `Stagehand::Errors::APITimeoutError` is raised.
@@ -145,8 +134,7 @@ Note: the `extra_` parameters of the same name overrides the documented paramete
145134
```ruby
146135
response =
147136
stagehand.sessions.start(
148-
browserbase_api_key: "your Browserbase API key",
149-
browserbase_project_id: "your Browserbase Project ID",
137+
model_name: "openai/gpt-5-nano",
150138
request_options: {
151139
extra_query: {my_query_parameter: value},
152140
extra_body: {my_body_parameter: value},
@@ -211,25 +199,25 @@ stagehand.sessions.act("00000000-your-session-id-000000000000", **params)
211199
Since this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime:
212200

213201
```ruby
214-
# :true
215-
puts(Stagehand::SessionActParams::XStreamResponse::TRUE)
202+
# :typescript
203+
puts(Stagehand::SessionActParams::XLanguage::TYPESCRIPT)
216204

217-
# Revealed type: `T.all(Stagehand::SessionActParams::XStreamResponse, Symbol)`
218-
T.reveal_type(Stagehand::SessionActParams::XStreamResponse::TRUE)
205+
# Revealed type: `T.all(Stagehand::SessionActParams::XLanguage, Symbol)`
206+
T.reveal_type(Stagehand::SessionActParams::XLanguage::TYPESCRIPT)
219207
```
220208

221209
Enum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value:
222210

223211
```ruby
224212
# Using the enum constants preserves the tagged type information:
225213
stagehand.sessions.act(
226-
x_stream_response: Stagehand::SessionActParams::XStreamResponse::TRUE,
214+
x_language: Stagehand::SessionActParams::XLanguage::TYPESCRIPT,
227215
#
228216
)
229217

230218
# Literal values are also permissible:
231219
stagehand.sessions.act(
232-
x_stream_response: :true,
220+
x_language: :typescript,
233221
#
234222
)
235223
```

lib/stagehand.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
require_relative "stagehand/models/session_act_response"
5959
require_relative "stagehand/models/session_end_params"
6060
require_relative "stagehand/models/session_end_response"
61-
require_relative "stagehand/models/session_execute_agent_params"
62-
require_relative "stagehand/models/session_execute_agent_response"
61+
require_relative "stagehand/models/session_execute_params"
62+
require_relative "stagehand/models/session_execute_response"
6363
require_relative "stagehand/models/session_extract_params"
6464
require_relative "stagehand/models/session_extract_response"
6565
require_relative "stagehand/models/session_navigate_params"

lib/stagehand/internal/transport/pooled_net_requester.rb

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,19 @@ def execute(request)
153153
end
154154

155155
self.class.calibrate_socket_timeout(conn, deadline)
156-
conn.request(req) do |rsp|
157-
y << [req, rsp]
158-
break if finished
159-
160-
rsp.read_body do |bytes|
161-
y << bytes.force_encoding(Encoding::BINARY)
162-
break if finished
163-
164-
self.class.calibrate_socket_timeout(conn, deadline)
156+
::Kernel.catch(:jump) do
157+
conn.request(req) do |rsp|
158+
y << [req, rsp]
159+
::Kernel.throw(:jump) if finished
160+
161+
rsp.read_body do |bytes|
162+
y << bytes.force_encoding(Encoding::BINARY)
163+
::Kernel.throw(:jump) if finished
164+
165+
self.class.calibrate_socket_timeout(conn, deadline)
166+
end
167+
eof = true
165168
end
166-
eof = true
167169
end
168170
end
169171
ensure

lib/stagehand/internal/type/base_model.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,9 @@ def deep_to_h = self.class.recursively_to_h(@data, convert: false)
440440
# @example
441441
# # `action` is a `Stagehand::Action`
442442
# action => {
443-
# arguments: arguments,
444443
# description: description,
445-
# method_: method_
444+
# selector: selector,
445+
# arguments: arguments
446446
# }
447447
def deconstruct_keys(keys)
448448
(keys || self.class.known_fields.keys)

lib/stagehand/internal/type/union.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ module Type
66
# @api private
77
#
88
# @example
9-
# # `session_extract_response` is a `Stagehand::Models::SessionExtractResponse`
10-
# case session_extract_response
11-
# when Stagehand::Models::SessionExtractResponse::Extraction
12-
# puts(session_extract_response.extraction)
13-
# when Stagehand::Models::SessionExtractResponse::CustomMap
9+
# # `model_config` is a `Stagehand::ModelConfig`
10+
# case model_config
11+
# when String
1412
# # ...
13+
# when Stagehand::ModelConfig::ModelConfigObject
14+
# puts(model_config.model_name)
1515
# else
16-
# puts(session_extract_response)
16+
# puts(model_config)
1717
# end
1818
module Union
1919
include Stagehand::Internal::Type::Converter

lib/stagehand/models.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ module Stagehand
4747

4848
SessionEndParams = Stagehand::Models::SessionEndParams
4949

50-
SessionExecuteAgentParams = Stagehand::Models::SessionExecuteAgentParams
50+
SessionExecuteParams = Stagehand::Models::SessionExecuteParams
5151

5252
SessionExtractParams = Stagehand::Models::SessionExtractParams
5353

0 commit comments

Comments
 (0)