1717 * @phpstan-import-type VariableShape from \Stagehand\Sessions\SessionObserveParams\Options\Variable
1818 *
1919 * @phpstan-type OptionsShape = array{
20+ * ignoreSelectors?: list<string>|null,
2021 * model?: ModelShape|null,
2122 * selector?: string|null,
2223 * timeout?: float|null,
@@ -28,6 +29,14 @@ final class Options implements BaseModel
2829 /** @use SdkModel<OptionsShape> */
2930 use SdkModel;
3031
32+ /**
33+ * Selectors for elements and subtrees that should be excluded from observation.
34+ *
35+ * @var list<string>|null $ignoreSelectors
36+ */
37+ #[Optional(list: 'string ' )]
38+ public ?array $ ignoreSelectors ;
39+
3140 /**
3241 * Model configuration object or model name string (e.g., 'openai/gpt-5-nano').
3342 *
@@ -66,17 +75,20 @@ public function __construct()
6675 *
6776 * You must use named parameters to construct any parameters with a default value.
6877 *
78+ * @param list<string>|null $ignoreSelectors
6979 * @param ModelShape|null $model
7080 * @param array<string,VariableShape>|null $variables
7181 */
7282 public static function with (
83+ ?array $ ignoreSelectors = null ,
7384 string |ModelConfig |array |null $ model = null ,
7485 ?string $ selector = null ,
7586 ?float $ timeout = null ,
7687 ?array $ variables = null ,
7788 ): self {
7889 $ self = new self ;
7990
91+ null !== $ ignoreSelectors && $ self ['ignoreSelectors ' ] = $ ignoreSelectors ;
8092 null !== $ model && $ self ['model ' ] = $ model ;
8193 null !== $ selector && $ self ['selector ' ] = $ selector ;
8294 null !== $ timeout && $ self ['timeout ' ] = $ timeout ;
@@ -85,6 +97,19 @@ public static function with(
8597 return $ self ;
8698 }
8799
100+ /**
101+ * Selectors for elements and subtrees that should be excluded from observation.
102+ *
103+ * @param list<string> $ignoreSelectors
104+ */
105+ public function withIgnoreSelectors (array $ ignoreSelectors ): self
106+ {
107+ $ self = clone $ this ;
108+ $ self ['ignoreSelectors ' ] = $ ignoreSelectors ;
109+
110+ return $ self ;
111+ }
112+
88113 /**
89114 * Model configuration object or model name string (e.g., 'openai/gpt-5-nano').
90115 *
0 commit comments