From 720a537000903162af127af6c5ba6d3c97d4a0dd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 21 Jan 2026 03:04:12 +0000 Subject: [PATCH 1/2] feat: add v3 integration tests matching cloud exactly --- .stats.yml | 6 ++-- src/Sessions/SessionActParams/Options.php | 22 ++++++++----- .../SessionActParams/Options/Model.php | 31 +++++++++++++++++++ .../SessionExecuteParams/AgentConfig.php | 22 ++++++++----- .../AgentConfig/Model.php | 31 +++++++++++++++++++ src/Sessions/SessionExtractParams/Options.php | 24 ++++++++------ .../SessionExtractParams/Options/Model.php | 31 +++++++++++++++++++ src/Sessions/SessionObserveParams/Options.php | 24 ++++++++------ .../SessionObserveParams/Options/Model.php | 31 +++++++++++++++++++ 9 files changed, 187 insertions(+), 35 deletions(-) create mode 100644 src/Sessions/SessionActParams/Options/Model.php create mode 100644 src/Sessions/SessionExecuteParams/AgentConfig/Model.php create mode 100644 src/Sessions/SessionExtractParams/Options/Model.php create mode 100644 src/Sessions/SessionObserveParams/Options/Model.php diff --git a/.stats.yml b/.stats.yml index babf0f2..1e55acc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 7 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-2132f9afd90a3b3c35b772f0de3ac8432cfe46ecfa22ec9c1ed4a3d0eda1ad41.yml -openapi_spec_hash: 6da568c2948d8ab6000db4291e15a033 -config_hash: 64c9cc393de93af70e11dbf0b1ba9388 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-1c405024b4a17886e921871250a445362463b7ae6070cacc3d1927d59036730c.yml +openapi_spec_hash: c4ea3735257a48ed105002eb7aaa095a +config_hash: 85d56c7c196269badbd0b4a9dfb28d45 diff --git a/src/Sessions/SessionActParams/Options.php b/src/Sessions/SessionActParams/Options.php index 60ae9cd..587c413 100644 --- a/src/Sessions/SessionActParams/Options.php +++ b/src/Sessions/SessionActParams/Options.php @@ -10,10 +10,11 @@ use Stagehand\Sessions\ModelConfig; /** - * @phpstan-import-type ModelConfigShape from \Stagehand\Sessions\ModelConfig + * @phpstan-import-type ModelVariants from \Stagehand\Sessions\SessionActParams\Options\Model + * @phpstan-import-type ModelShape from \Stagehand\Sessions\SessionActParams\Options\Model * * @phpstan-type OptionsShape = array{ - * model?: null|ModelConfig|ModelConfigShape, + * model?: ModelShape|null, * timeout?: float|null, * variables?: array|null, * } @@ -23,8 +24,13 @@ final class Options implements BaseModel /** @use SdkModel */ use SdkModel; + /** + * Model configuration object or model name string (e.g., 'openai/gpt-5-nano'). + * + * @var ModelVariants|null $model + */ #[Optional] - public ?ModelConfig $model; + public string|ModelConfig|null $model; /** * Timeout in ms for the action. @@ -50,11 +56,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param ModelConfig|ModelConfigShape|null $model + * @param ModelShape|null $model * @param array|null $variables */ public static function with( - ModelConfig|array|null $model = null, + string|ModelConfig|array|null $model = null, ?float $timeout = null, ?array $variables = null, ): self { @@ -68,9 +74,11 @@ public static function with( } /** - * @param ModelConfig|ModelConfigShape $model + * Model configuration object or model name string (e.g., 'openai/gpt-5-nano'). + * + * @param ModelShape $model */ - public function withModel(ModelConfig|array $model): self + public function withModel(string|ModelConfig|array $model): self { $self = clone $this; $self['model'] = $model; diff --git a/src/Sessions/SessionActParams/Options/Model.php b/src/Sessions/SessionActParams/Options/Model.php new file mode 100644 index 0000000..5e958e2 --- /dev/null +++ b/src/Sessions/SessionActParams/Options/Model.php @@ -0,0 +1,31 @@ +|array + */ + public static function variants(): array + { + return [ModelConfig::class, 'string']; + } +} diff --git a/src/Sessions/SessionExecuteParams/AgentConfig.php b/src/Sessions/SessionExecuteParams/AgentConfig.php index d30f6f1..38d28df 100644 --- a/src/Sessions/SessionExecuteParams/AgentConfig.php +++ b/src/Sessions/SessionExecuteParams/AgentConfig.php @@ -11,11 +11,12 @@ use Stagehand\Sessions\SessionExecuteParams\AgentConfig\Provider; /** - * @phpstan-import-type ModelConfigShape from \Stagehand\Sessions\ModelConfig + * @phpstan-import-type ModelVariants from \Stagehand\Sessions\SessionExecuteParams\AgentConfig\Model + * @phpstan-import-type ModelShape from \Stagehand\Sessions\SessionExecuteParams\AgentConfig\Model * * @phpstan-type AgentConfigShape = array{ * cua?: bool|null, - * model?: null|ModelConfig|ModelConfigShape, + * model?: ModelShape|null, * provider?: null|Provider|value-of, * systemPrompt?: string|null, * } @@ -31,8 +32,13 @@ final class AgentConfig implements BaseModel #[Optional] public ?bool $cua; + /** + * Model configuration object or model name string (e.g., 'openai/gpt-5-nano'). + * + * @var ModelVariants|null $model + */ #[Optional] - public ?ModelConfig $model; + public string|ModelConfig|null $model; /** * AI provider for the agent (legacy, use model: openai/gpt-5-nano instead). @@ -58,12 +64,12 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param ModelConfig|ModelConfigShape|null $model + * @param ModelShape|null $model * @param Provider|value-of|null $provider */ public static function with( ?bool $cua = null, - ModelConfig|array|null $model = null, + string|ModelConfig|array|null $model = null, Provider|string|null $provider = null, ?string $systemPrompt = null, ): self { @@ -89,9 +95,11 @@ public function withCua(bool $cua): self } /** - * @param ModelConfig|ModelConfigShape $model + * Model configuration object or model name string (e.g., 'openai/gpt-5-nano'). + * + * @param ModelShape $model */ - public function withModel(ModelConfig|array $model): self + public function withModel(string|ModelConfig|array $model): self { $self = clone $this; $self['model'] = $model; diff --git a/src/Sessions/SessionExecuteParams/AgentConfig/Model.php b/src/Sessions/SessionExecuteParams/AgentConfig/Model.php new file mode 100644 index 0000000..0be2be0 --- /dev/null +++ b/src/Sessions/SessionExecuteParams/AgentConfig/Model.php @@ -0,0 +1,31 @@ +|array + */ + public static function variants(): array + { + return [ModelConfig::class, 'string']; + } +} diff --git a/src/Sessions/SessionExtractParams/Options.php b/src/Sessions/SessionExtractParams/Options.php index 3ebbeda..835c3b1 100644 --- a/src/Sessions/SessionExtractParams/Options.php +++ b/src/Sessions/SessionExtractParams/Options.php @@ -10,12 +10,11 @@ use Stagehand\Sessions\ModelConfig; /** - * @phpstan-import-type ModelConfigShape from \Stagehand\Sessions\ModelConfig + * @phpstan-import-type ModelVariants from \Stagehand\Sessions\SessionExtractParams\Options\Model + * @phpstan-import-type ModelShape from \Stagehand\Sessions\SessionExtractParams\Options\Model * * @phpstan-type OptionsShape = array{ - * model?: null|ModelConfig|ModelConfigShape, - * selector?: string|null, - * timeout?: float|null, + * model?: ModelShape|null, selector?: string|null, timeout?: float|null * } */ final class Options implements BaseModel @@ -23,8 +22,13 @@ final class Options implements BaseModel /** @use SdkModel */ use SdkModel; + /** + * Model configuration object or model name string (e.g., 'openai/gpt-5-nano'). + * + * @var ModelVariants|null $model + */ #[Optional] - public ?ModelConfig $model; + public string|ModelConfig|null $model; /** * CSS selector to scope extraction to a specific element. @@ -48,10 +52,10 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param ModelConfig|ModelConfigShape|null $model + * @param ModelShape|null $model */ public static function with( - ModelConfig|array|null $model = null, + string|ModelConfig|array|null $model = null, ?string $selector = null, ?float $timeout = null, ): self { @@ -65,9 +69,11 @@ public static function with( } /** - * @param ModelConfig|ModelConfigShape $model + * Model configuration object or model name string (e.g., 'openai/gpt-5-nano'). + * + * @param ModelShape $model */ - public function withModel(ModelConfig|array $model): self + public function withModel(string|ModelConfig|array $model): self { $self = clone $this; $self['model'] = $model; diff --git a/src/Sessions/SessionExtractParams/Options/Model.php b/src/Sessions/SessionExtractParams/Options/Model.php new file mode 100644 index 0000000..e99f0ed --- /dev/null +++ b/src/Sessions/SessionExtractParams/Options/Model.php @@ -0,0 +1,31 @@ +|array + */ + public static function variants(): array + { + return [ModelConfig::class, 'string']; + } +} diff --git a/src/Sessions/SessionObserveParams/Options.php b/src/Sessions/SessionObserveParams/Options.php index 58aa0cc..cf545e9 100644 --- a/src/Sessions/SessionObserveParams/Options.php +++ b/src/Sessions/SessionObserveParams/Options.php @@ -10,12 +10,11 @@ use Stagehand\Sessions\ModelConfig; /** - * @phpstan-import-type ModelConfigShape from \Stagehand\Sessions\ModelConfig + * @phpstan-import-type ModelVariants from \Stagehand\Sessions\SessionObserveParams\Options\Model + * @phpstan-import-type ModelShape from \Stagehand\Sessions\SessionObserveParams\Options\Model * * @phpstan-type OptionsShape = array{ - * model?: null|ModelConfig|ModelConfigShape, - * selector?: string|null, - * timeout?: float|null, + * model?: ModelShape|null, selector?: string|null, timeout?: float|null * } */ final class Options implements BaseModel @@ -23,8 +22,13 @@ final class Options implements BaseModel /** @use SdkModel */ use SdkModel; + /** + * Model configuration object or model name string (e.g., 'openai/gpt-5-nano'). + * + * @var ModelVariants|null $model + */ #[Optional] - public ?ModelConfig $model; + public string|ModelConfig|null $model; /** * CSS selector to scope observation to a specific element. @@ -48,10 +52,10 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param ModelConfig|ModelConfigShape|null $model + * @param ModelShape|null $model */ public static function with( - ModelConfig|array|null $model = null, + string|ModelConfig|array|null $model = null, ?string $selector = null, ?float $timeout = null, ): self { @@ -65,9 +69,11 @@ public static function with( } /** - * @param ModelConfig|ModelConfigShape $model + * Model configuration object or model name string (e.g., 'openai/gpt-5-nano'). + * + * @param ModelShape $model */ - public function withModel(ModelConfig|array $model): self + public function withModel(string|ModelConfig|array $model): self { $self = clone $this; $self['model'] = $model; diff --git a/src/Sessions/SessionObserveParams/Options/Model.php b/src/Sessions/SessionObserveParams/Options/Model.php new file mode 100644 index 0000000..094f3ad --- /dev/null +++ b/src/Sessions/SessionObserveParams/Options/Model.php @@ -0,0 +1,31 @@ +|array + */ + public static function variants(): array + { + return [ModelConfig::class, 'string']; + } +} From 530448181ab15ca97c5db63f995058050e2895a2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 21 Jan 2026 03:04:27 +0000 Subject: [PATCH 2/2] release: 3.6.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ src/Version.php | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bf0d036..f391d41 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.5.0" + ".": "3.6.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 069d313..2029652 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 3.6.0 (2026-01-21) + +Full Changelog: [v3.5.0...v3.6.0](https://github.com/browserbase/stagehand-php/compare/v3.5.0...v3.6.0) + +### Features + +* add v3 integration tests matching cloud exactly ([720a537](https://github.com/browserbase/stagehand-php/commit/720a537000903162af127af6c5ba6d3c97d4a0dd)) + ## 3.5.0 (2026-01-21) Full Changelog: [v3.4.0...v3.5.0](https://github.com/browserbase/stagehand-php/compare/v3.4.0...v3.5.0) diff --git a/src/Version.php b/src/Version.php index 5d53111..1ee788e 100644 --- a/src/Version.php +++ b/src/Version.php @@ -5,5 +5,5 @@ namespace Stagehand; // x-release-please-start-version -const VERSION = '3.5.0'; +const VERSION = '3.6.0'; // x-release-please-end