Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "3.8.0"
".": "3.9.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 8
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-089c8670f1d7c2e9fa8e5c97010db7c24b8f162eb7cfe76ffa41d70fa46efe2f.yml
openapi_spec_hash: 7a226aee8f3f2ab16febbe6bb35e1657
config_hash: 242651c4871c2869ba3c2e3d337505b9
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-43e6dd4ce19381de488d296e9036fea15bfea9a6f946cf8ccf4e02aecc8fb765.yml
openapi_spec_hash: f736e7a8acea0d73e1031c86ea803246
config_hash: 75b561cd2ba925e4f2a62ec2f1d13738
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 3.9.0 (2026-01-27)

Full Changelog: [v3.8.0...v3.9.0](https://github.com/browserbase/stagehand-php/compare/v3.8.0...v3.9.0)

### Features

* add auto-bedrock support based on bedrock/provider.model-name ([dd558cc](https://github.com/browserbase/stagehand-php/commit/dd558cca501859f0fc80eb2725c7718015160d85))

## 3.8.0 (2026-01-27)

Full Changelog: [v3.7.0...v3.8.0](https://github.com/browserbase/stagehand-php/compare/v3.7.0...v3.8.0)
Expand Down
30 changes: 28 additions & 2 deletions src/Sessions/SessionExecuteParams/AgentConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Stagehand\Core\Concerns\SdkModel;
use Stagehand\Core\Contracts\BaseModel;
use Stagehand\Sessions\ModelConfig;
use Stagehand\Sessions\SessionExecuteParams\AgentConfig\Mode;
use Stagehand\Sessions\SessionExecuteParams\AgentConfig\Provider;

/**
Expand All @@ -16,6 +17,7 @@
*
* @phpstan-type AgentConfigShape = array{
* cua?: bool|null,
* mode?: null|Mode|value-of<Mode>,
* model?: ModelShape|null,
* provider?: null|Provider|value-of<Provider>,
* systemPrompt?: string|null,
Expand All @@ -27,11 +29,19 @@ final class AgentConfig implements BaseModel
use SdkModel;

/**
* Enable Computer Use Agent mode.
* Deprecated. Use mode: 'cua' instead. If both are provided, mode takes precedence.
*/
#[Optional]
public ?bool $cua;

/**
* Tool mode for the agent (dom, hybrid, cua). If set, overrides cua.
*
* @var value-of<Mode>|null $mode
*/
#[Optional(enum: Mode::class)]
public ?string $mode;

/**
* Model configuration object or model name string (e.g., 'openai/gpt-5-nano').
*
Expand Down Expand Up @@ -64,18 +74,21 @@ public function __construct()
*
* You must use named parameters to construct any parameters with a default value.
*
* @param Mode|value-of<Mode>|null $mode
* @param ModelShape|null $model
* @param Provider|value-of<Provider>|null $provider
*/
public static function with(
?bool $cua = null,
Mode|string|null $mode = null,
string|ModelConfig|array|null $model = null,
Provider|string|null $provider = null,
?string $systemPrompt = null,
): self {
$self = new self;

null !== $cua && $self['cua'] = $cua;
null !== $mode && $self['mode'] = $mode;
null !== $model && $self['model'] = $model;
null !== $provider && $self['provider'] = $provider;
null !== $systemPrompt && $self['systemPrompt'] = $systemPrompt;
Expand All @@ -84,7 +97,7 @@ public static function with(
}

/**
* Enable Computer Use Agent mode.
* Deprecated. Use mode: 'cua' instead. If both are provided, mode takes precedence.
*/
public function withCua(bool $cua): self
{
Expand All @@ -94,6 +107,19 @@ public function withCua(bool $cua): self
return $self;
}

/**
* Tool mode for the agent (dom, hybrid, cua). If set, overrides cua.
*
* @param Mode|value-of<Mode> $mode
*/
public function withMode(Mode|string $mode): self
{
$self = clone $this;
$self['mode'] = $mode;

return $self;
}

/**
* Model configuration object or model name string (e.g., 'openai/gpt-5-nano').
*
Expand Down
17 changes: 17 additions & 0 deletions src/Sessions/SessionExecuteParams/AgentConfig/Mode.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

namespace Stagehand\Sessions\SessionExecuteParams\AgentConfig;

/**
* Tool mode for the agent (dom, hybrid, cua). If set, overrides cua.
*/
enum Mode: string
{
case DOM = 'dom';

case HYBRID = 'hybrid';

case CUA = 'cua';
}
2 changes: 1 addition & 1 deletion src/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
namespace Stagehand;

// x-release-please-start-version
const VERSION = '3.8.0';
const VERSION = '3.9.0';
// x-release-please-end
1 change: 1 addition & 0 deletions tests/Services/SessionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public function testExecuteWithOptionalParams(): void
'c4dbf3a9-9a58-4b22-8a1c-9f20f9f9e123',
agentConfig: [
'cua' => true,
'mode' => 'cua',
'model' => [
'modelName' => 'openai/gpt-5-nano',
'apiKey' => 'sk-some-openai-api-key',
Expand Down