Skip to content

Commit f5b7983

Browse files
feat(api): manual updates
1 parent 7d51568 commit f5b7983

15 files changed

Lines changed: 149 additions & 41 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 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-d571232203ef4e00986a3245224267db6f8aaffdad57780f712e0694dc8d9e37.yml
3-
openapi_spec_hash: d5d635dd7b24a2e1255c6f2a895253ff
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-817d1d4e845b1946dac8ee10fd34b3f533aa36f74ac598582ffb1b0399a5a932.yml
3+
openapi_spec_hash: 9d856db62b34909fec94743235b3d7be
44
config_hash: 88e87ba7021be93d267ecfc8f5e6b891

src/ServiceContracts/SessionsContract.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Stagehand\Sessions\SessionStartParams\BrowserbaseSessionCreateParams\BrowserSettings\Fingerprint\HTTPVersion;
2222
use Stagehand\Sessions\SessionStartParams\BrowserbaseSessionCreateParams\BrowserSettings\Fingerprint\OperatingSystem;
2323
use Stagehand\Sessions\SessionStartParams\BrowserbaseSessionCreateParams\Region;
24+
use Stagehand\Sessions\SessionStartParams\Verbose;
2425
use Stagehand\Sessions\SessionStartResponse;
2526

2627
interface SessionsContract
@@ -270,7 +271,7 @@ public function observe(
270271
* @param bool $experimental Body param:
271272
* @param bool $selfHeal Body param: Enable self-healing for failed actions
272273
* @param string $systemPrompt Body param: Custom system prompt for AI operations
273-
* @param int $verbose Body param: Logging verbosity level (0=quiet, 1=normal, 2=debug)
274+
* @param 0|1|2|Verbose $verbose Body param: Logging verbosity level (0=quiet, 1=normal, 2=debug)
274275
* @param bool $waitForCaptchaSolves Body param:
275276
* @param 'typescript'|'python'|'playground'|\Stagehand\Sessions\SessionStartParams\XLanguage $xLanguage Header param: Client SDK language
276277
* @param string $xSDKVersion Header param: Version of the Stagehand SDK
@@ -290,7 +291,7 @@ public function start(
290291
?bool $experimental = null,
291292
?bool $selfHeal = null,
292293
?string $systemPrompt = null,
293-
?int $verbose = null,
294+
int|Verbose|null $verbose = null,
294295
?bool $waitForCaptchaSolves = null,
295296
string|\Stagehand\Sessions\SessionStartParams\XLanguage|null $xLanguage = null,
296297
?string $xSDKVersion = null,

src/Services/SessionsRawService.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
use Stagehand\Sessions\SessionStartParams\Browser\Type;
3030
use Stagehand\Sessions\SessionStartParams\BrowserbaseSessionCreateParams\BrowserSettings\Fingerprint\HTTPVersion;
3131
use Stagehand\Sessions\SessionStartParams\BrowserbaseSessionCreateParams\Region;
32+
use Stagehand\Sessions\SessionStartParams\Verbose;
3233
use Stagehand\Sessions\SessionStartResponse;
3334

3435
final class SessionsRawService implements SessionsRawContract
@@ -444,7 +445,7 @@ public function observe(
444445
* experimental?: bool,
445446
* selfHeal?: bool,
446447
* systemPrompt?: string,
447-
* verbose?: int,
448+
* verbose?: 0|1|2|Verbose,
448449
* waitForCaptchaSolves?: bool,
449450
* xLanguage?: 'typescript'|'python'|'playground'|SessionStartParams\XLanguage,
450451
* xSDKVersion?: string,

src/Services/SessionsService.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use Stagehand\Sessions\SessionStartParams\BrowserbaseSessionCreateParams\BrowserSettings\Fingerprint\HTTPVersion;
2525
use Stagehand\Sessions\SessionStartParams\BrowserbaseSessionCreateParams\BrowserSettings\Fingerprint\OperatingSystem;
2626
use Stagehand\Sessions\SessionStartParams\BrowserbaseSessionCreateParams\Region;
27+
use Stagehand\Sessions\SessionStartParams\Verbose;
2728
use Stagehand\Sessions\SessionStartResponse;
2829

2930
final class SessionsService implements SessionsContract
@@ -400,7 +401,7 @@ public function observe(
400401
* @param bool $experimental Body param:
401402
* @param bool $selfHeal Body param: Enable self-healing for failed actions
402403
* @param string $systemPrompt Body param: Custom system prompt for AI operations
403-
* @param int $verbose Body param: Logging verbosity level (0=quiet, 1=normal, 2=debug)
404+
* @param 0|1|2|Verbose $verbose Body param: Logging verbosity level (0=quiet, 1=normal, 2=debug)
404405
* @param bool $waitForCaptchaSolves Body param:
405406
* @param 'typescript'|'python'|'playground'|\Stagehand\Sessions\SessionStartParams\XLanguage $xLanguage Header param: Client SDK language
406407
* @param string $xSDKVersion Header param: Version of the Stagehand SDK
@@ -420,7 +421,7 @@ public function start(
420421
?bool $experimental = null,
421422
?bool $selfHeal = null,
422423
?string $systemPrompt = null,
423-
?int $verbose = null,
424+
int|Verbose|null $verbose = null,
424425
?bool $waitForCaptchaSolves = null,
425426
string|\Stagehand\Sessions\SessionStartParams\XLanguage|null $xLanguage = null,
426427
?string $xSDKVersion = null,

src/Sessions/ModelConfig.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
use Stagehand\Core\Concerns\SdkUnion;
88
use Stagehand\Core\Conversion\Contracts\Converter;
99
use Stagehand\Core\Conversion\Contracts\ConverterSource;
10-
use Stagehand\Sessions\ModelConfig\UnionMember1;
10+
use Stagehand\Sessions\ModelConfig\ModelConfigObject;
1111

1212
/**
13-
* @phpstan-import-type UnionMember1Shape from \Stagehand\Sessions\ModelConfig\UnionMember1
13+
* Model name string with provider prefix (e.g., 'openai/gpt-5-nano', 'anthropic/claude-4.5-opus').
1414
*
15-
* @phpstan-type ModelConfigShape = string|UnionMember1Shape
15+
* @phpstan-import-type ModelConfigObjectShape from \Stagehand\Sessions\ModelConfig\ModelConfigObject
16+
*
17+
* @phpstan-type ModelConfigShape = string|ModelConfigObjectShape
1618
*/
1719
final class ModelConfig implements ConverterSource
1820
{
@@ -23,6 +25,6 @@ final class ModelConfig implements ConverterSource
2325
*/
2426
public static function variants(): array
2527
{
26-
return ['string', UnionMember1::class];
28+
return ['string', ModelConfigObject::class];
2729
}
2830
}

src/Sessions/ModelConfig/UnionMember1.php renamed to src/Sessions/ModelConfig/ModelConfigObject.php

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,45 @@
1010
use Stagehand\Core\Contracts\BaseModel;
1111

1212
/**
13-
* @phpstan-type UnionMember1Shape = array{
13+
* @phpstan-type ModelConfigObjectShape = array{
1414
* modelName: string, apiKey?: string|null, baseURL?: string|null
1515
* }
1616
*/
17-
final class UnionMember1 implements BaseModel
17+
final class ModelConfigObject implements BaseModel
1818
{
19-
/** @use SdkModel<UnionMember1Shape> */
19+
/** @use SdkModel<ModelConfigObjectShape> */
2020
use SdkModel;
2121

22+
/**
23+
* Model name string without prefix (e.g., 'gpt-5-nano', 'claude-4.5-opus').
24+
*/
2225
#[Required]
2326
public string $modelName;
2427

28+
/**
29+
* API key for the model provider.
30+
*/
2531
#[Optional]
2632
public ?string $apiKey;
2733

34+
/**
35+
* Base URL for the model provider.
36+
*/
2837
#[Optional]
2938
public ?string $baseURL;
3039

3140
/**
32-
* `new UnionMember1()` is missing required properties by the API.
41+
* `new ModelConfigObject()` is missing required properties by the API.
3342
*
3443
* To enforce required parameters use
3544
* ```
36-
* UnionMember1::with(modelName: ...)
45+
* ModelConfigObject::with(modelName: ...)
3746
* ```
3847
*
3948
* Otherwise ensure the following setters are called
4049
*
4150
* ```
42-
* (new UnionMember1)->withModelName(...)
51+
* (new ModelConfigObject)->withModelName(...)
4352
* ```
4453
*/
4554
public function __construct()
@@ -67,6 +76,9 @@ public static function with(
6776
return $self;
6877
}
6978

79+
/**
80+
* Model name string without prefix (e.g., 'gpt-5-nano', 'claude-4.5-opus').
81+
*/
7082
public function withModelName(string $modelName): self
7183
{
7284
$self = clone $this;
@@ -75,6 +87,9 @@ public function withModelName(string $modelName): self
7587
return $self;
7688
}
7789

90+
/**
91+
* API key for the model provider.
92+
*/
7893
public function withAPIKey(string $apiKey): self
7994
{
8095
$self = clone $this;
@@ -83,6 +98,9 @@ public function withAPIKey(string $apiKey): self
8398
return $self;
8499
}
85100

101+
/**
102+
* Base URL for the model provider.
103+
*/
86104
public function withBaseURL(string $baseURL): self
87105
{
88106
$self = clone $this;

src/Sessions/SessionActParams/Options.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Stagehand\Core\Attributes\Optional;
88
use Stagehand\Core\Concerns\SdkModel;
99
use Stagehand\Core\Contracts\BaseModel;
10-
use Stagehand\Sessions\ModelConfig\UnionMember1;
10+
use Stagehand\Sessions\ModelConfig\ModelConfigObject;
1111

1212
/**
1313
* @phpstan-import-type ModelConfigShape from \Stagehand\Sessions\ModelConfig
@@ -23,8 +23,11 @@ final class Options implements BaseModel
2323
/** @use SdkModel<OptionsShape> */
2424
use SdkModel;
2525

26+
/**
27+
* Model name string with provider prefix (e.g., 'openai/gpt-5-nano', 'anthropic/claude-4.5-opus').
28+
*/
2629
#[Optional]
27-
public string|UnionMember1|null $model;
30+
public string|ModelConfigObject|null $model;
2831

2932
/**
3033
* Timeout in ms for the action.
@@ -54,7 +57,7 @@ public function __construct()
5457
* @param array<string,string> $variables
5558
*/
5659
public static function with(
57-
string|UnionMember1|array|null $model = null,
60+
string|ModelConfigObject|array|null $model = null,
5861
?float $timeout = null,
5962
?array $variables = null,
6063
): self {
@@ -68,9 +71,11 @@ public static function with(
6871
}
6972

7073
/**
74+
* Model name string with provider prefix (e.g., 'openai/gpt-5-nano', 'anthropic/claude-4.5-opus').
75+
*
7176
* @param ModelConfigShape $model
7277
*/
73-
public function withModel(string|UnionMember1|array $model): self
78+
public function withModel(string|ModelConfigObject|array $model): self
7479
{
7580
$self = clone $this;
7681
$self['model'] = $model;

src/Sessions/SessionEndResponse.php

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,26 @@ final class SessionEndResponse implements BaseModel
1616
/** @use SdkModel<SessionEndResponseShape> */
1717
use SdkModel;
1818

19+
/**
20+
* Indicates whether the request was successful.
21+
*/
1922
#[Required]
20-
public bool $success = true;
23+
public bool $success;
2124

25+
/**
26+
* `new SessionEndResponse()` is missing required properties by the API.
27+
*
28+
* To enforce required parameters use
29+
* ```
30+
* SessionEndResponse::with(success: ...)
31+
* ```
32+
*
33+
* Otherwise ensure the following setters are called
34+
*
35+
* ```
36+
* (new SessionEndResponse)->withSuccess(...)
37+
* ```
38+
*/
2239
public function __construct()
2340
{
2441
$this->initialize();
@@ -29,8 +46,23 @@ public function __construct()
2946
*
3047
* You must use named parameters to construct any parameters with a default value.
3148
*/
32-
public static function with(): self
49+
public static function with(bool $success): self
3350
{
34-
return new self;
51+
$self = new self;
52+
53+
$self['success'] = $success;
54+
55+
return $self;
56+
}
57+
58+
/**
59+
* Indicates whether the request was successful.
60+
*/
61+
public function withSuccess(bool $success): self
62+
{
63+
$self = clone $this;
64+
$self['success'] = $success;
65+
66+
return $self;
3567
}
3668
}

src/Sessions/SessionExecuteParams/AgentConfig.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Stagehand\Core\Attributes\Optional;
88
use Stagehand\Core\Concerns\SdkModel;
99
use Stagehand\Core\Contracts\BaseModel;
10-
use Stagehand\Sessions\ModelConfig\UnionMember1;
10+
use Stagehand\Sessions\ModelConfig\ModelConfigObject;
1111

1212
/**
1313
* @phpstan-import-type ModelConfigShape from \Stagehand\Sessions\ModelConfig
@@ -27,8 +27,11 @@ final class AgentConfig implements BaseModel
2727
#[Optional]
2828
public ?bool $cua;
2929

30+
/**
31+
* Model name string with provider prefix (e.g., 'openai/gpt-5-nano', 'anthropic/claude-4.5-opus').
32+
*/
3033
#[Optional]
31-
public string|UnionMember1|null $model;
34+
public string|ModelConfigObject|null $model;
3235

3336
/**
3437
* Custom system prompt for the agent.
@@ -50,7 +53,7 @@ public function __construct()
5053
*/
5154
public static function with(
5255
?bool $cua = null,
53-
string|UnionMember1|array|null $model = null,
56+
string|ModelConfigObject|array|null $model = null,
5457
?string $systemPrompt = null,
5558
): self {
5659
$self = new self;
@@ -74,9 +77,11 @@ public function withCua(bool $cua): self
7477
}
7578

7679
/**
80+
* Model name string with provider prefix (e.g., 'openai/gpt-5-nano', 'anthropic/claude-4.5-opus').
81+
*
7782
* @param ModelConfigShape $model
7883
*/
79-
public function withModel(string|UnionMember1|array $model): self
84+
public function withModel(string|ModelConfigObject|array $model): self
8085
{
8186
$self = clone $this;
8287
$self['model'] = $model;

src/Sessions/SessionExtractParams/Options.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Stagehand\Core\Attributes\Optional;
88
use Stagehand\Core\Concerns\SdkModel;
99
use Stagehand\Core\Contracts\BaseModel;
10-
use Stagehand\Sessions\ModelConfig\UnionMember1;
10+
use Stagehand\Sessions\ModelConfig\ModelConfigObject;
1111

1212
/**
1313
* @phpstan-import-type ModelConfigShape from \Stagehand\Sessions\ModelConfig
@@ -21,8 +21,11 @@ final class Options implements BaseModel
2121
/** @use SdkModel<OptionsShape> */
2222
use SdkModel;
2323

24+
/**
25+
* Model name string with provider prefix (e.g., 'openai/gpt-5-nano', 'anthropic/claude-4.5-opus').
26+
*/
2427
#[Optional]
25-
public string|UnionMember1|null $model;
28+
public string|ModelConfigObject|null $model;
2629

2730
/**
2831
* CSS selector to scope extraction to a specific element.
@@ -49,7 +52,7 @@ public function __construct()
4952
* @param ModelConfigShape $model
5053
*/
5154
public static function with(
52-
string|UnionMember1|array|null $model = null,
55+
string|ModelConfigObject|array|null $model = null,
5356
?string $selector = null,
5457
?float $timeout = null,
5558
): self {
@@ -63,9 +66,11 @@ public static function with(
6366
}
6467

6568
/**
69+
* Model name string with provider prefix (e.g., 'openai/gpt-5-nano', 'anthropic/claude-4.5-opus').
70+
*
6671
* @param ModelConfigShape $model
6772
*/
68-
public function withModel(string|UnionMember1|array $model): self
73+
public function withModel(string|ModelConfigObject|array $model): self
6974
{
7075
$self = clone $this;
7176
$self['model'] = $model;

0 commit comments

Comments
 (0)