Skip to content

Commit 28fb2d3

Browse files
feat: Accept telemetry.storage and settle it at browser create
Stainless-Generated-From: 8f39036711533f5cf7d1dcae85d98c367dbf9d74
1 parent a91b543 commit 28fb2d3

18 files changed

Lines changed: 203 additions & 0 deletions

‎api.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ from kernel.types.browsers import (
207207
BrowserTelemetryEvent,
208208
BrowserTelemetryExportConfig,
209209
BrowserTelemetryOtlpExportConfig,
210+
BrowserTelemetryStorageConfig,
210211
TelemetryEventsResponse,
211212
TelemetryStreamResponse,
212213
)

‎src/kernel/types/auth/connection_create_params.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"BrowserTelemetryExport",
1616
"BrowserTelemetryExportOtlp",
1717
"BrowserTelemetryExportOtlpDestination",
18+
"BrowserTelemetryStorage",
1819
"Credential",
1920
"Proxy",
2021
]
@@ -166,6 +167,16 @@ class BrowserTelemetryExport(TypedDict, total=False):
166167
"""
167168

168169

170+
class BrowserTelemetryStorage(TypedDict, total=False):
171+
"""Whether to persist this session's captured telemetry to Kernel storage."""
172+
173+
enabled: bool
174+
"""Whether captured telemetry is persisted to Kernel storage.
175+
176+
Defaults to true. Setting false is not supported yet and is rejected.
177+
"""
178+
179+
169180
class BrowserTelemetry(TypedDict, total=False):
170181
"""Deprecated.
171182
@@ -205,6 +216,9 @@ class BrowserTelemetry(TypedDict, total=False):
205216
Omit to capture without exporting.
206217
"""
207218

219+
storage: BrowserTelemetryStorage
220+
"""Whether to persist this session's captured telemetry to Kernel storage."""
221+
208222

209223
class Credential(TypedDict, total=False):
210224
"""Reference to credentials for the auth connection.

‎src/kernel/types/auth/connection_login_params.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"BrowserTelemetryExport",
1515
"BrowserTelemetryExportOtlp",
1616
"BrowserTelemetryExportOtlpDestination",
17+
"BrowserTelemetryStorage",
1718
"Proxy",
1819
]
1920

@@ -92,6 +93,16 @@ class BrowserTelemetryExport(TypedDict, total=False):
9293
"""
9394

9495

96+
class BrowserTelemetryStorage(TypedDict, total=False):
97+
"""Whether to persist this session's captured telemetry to Kernel storage."""
98+
99+
enabled: bool
100+
"""Whether captured telemetry is persisted to Kernel storage.
101+
102+
Defaults to true. Setting false is not supported yet and is rejected.
103+
"""
104+
105+
95106
class BrowserTelemetry(TypedDict, total=False):
96107
"""Deprecated.
97108
@@ -131,6 +142,9 @@ class BrowserTelemetry(TypedDict, total=False):
131142
Omit to capture without exporting.
132143
"""
133144

145+
storage: BrowserTelemetryStorage
146+
"""Whether to persist this session's captured telemetry to Kernel storage."""
147+
134148

135149
class Proxy(TypedDict, total=False):
136150
"""Deprecated. Use browser.proxy. Retained during migration for existing clients."""

‎src/kernel/types/auth/connection_update_params.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"BrowserTelemetryExport",
1616
"BrowserTelemetryExportOtlp",
1717
"BrowserTelemetryExportOtlpDestination",
18+
"BrowserTelemetryStorage",
1819
"Credential",
1920
"Proxy",
2021
]
@@ -129,6 +130,16 @@ class BrowserTelemetryExport(TypedDict, total=False):
129130
"""
130131

131132

133+
class BrowserTelemetryStorage(TypedDict, total=False):
134+
"""Whether to persist this session's captured telemetry to Kernel storage."""
135+
136+
enabled: bool
137+
"""Whether captured telemetry is persisted to Kernel storage.
138+
139+
Defaults to true. Setting false is not supported yet and is rejected.
140+
"""
141+
142+
132143
class BrowserTelemetry(TypedDict, total=False):
133144
"""Deprecated.
134145
@@ -168,6 +179,9 @@ class BrowserTelemetry(TypedDict, total=False):
168179
Omit to capture without exporting.
169180
"""
170181

182+
storage: BrowserTelemetryStorage
183+
"""Whether to persist this session's captured telemetry to Kernel storage."""
184+
171185

172186
class Credential(TypedDict, total=False):
173187
"""Reference to credentials for the auth connection.

‎src/kernel/types/auth/managed_auth.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"BrowserTelemetryExport",
1515
"BrowserTelemetryExportOtlp",
1616
"BrowserTelemetryExportOtlpDestination",
17+
"BrowserTelemetryStorage",
1718
"Choice",
1819
"Credential",
1920
"DiscoveredField",
@@ -68,6 +69,16 @@ class BrowserTelemetryExport(BaseModel):
6869
"""
6970

7071

72+
class BrowserTelemetryStorage(BaseModel):
73+
"""Whether to persist this session's captured telemetry to Kernel storage."""
74+
75+
enabled: Optional[bool] = None
76+
"""Whether captured telemetry is persisted to Kernel storage.
77+
78+
Defaults to true. Setting false is not supported yet and is rejected.
79+
"""
80+
81+
7182
class BrowserTelemetry(BaseModel):
7283
"""Deprecated.
7384
@@ -107,6 +118,9 @@ class BrowserTelemetry(BaseModel):
107118
Omit to capture without exporting.
108119
"""
109120

121+
storage: Optional[BrowserTelemetryStorage] = None
122+
"""Whether to persist this session's captured telemetry to Kernel storage."""
123+
110124

111125
class Choice(BaseModel):
112126
"""Canonical auth-flow choice awaiting user selection."""

‎src/kernel/types/auth/managed_auth_browser_config.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"TelemetryExport",
1414
"TelemetryExportOtlp",
1515
"TelemetryExportOtlpDestination",
16+
"TelemetryStorage",
1617
]
1718

1819

@@ -60,6 +61,16 @@ class TelemetryExport(BaseModel):
6061
"""
6162

6263

64+
class TelemetryStorage(BaseModel):
65+
"""Whether to persist this session's captured telemetry to Kernel storage."""
66+
67+
enabled: Optional[bool] = None
68+
"""Whether captured telemetry is persisted to Kernel storage.
69+
70+
Defaults to true. Setting false is not supported yet and is rejected.
71+
"""
72+
73+
6374
class Telemetry(BaseModel):
6475
"""Browser telemetry configuration using the same semantics as browser create."""
6576

@@ -96,6 +107,9 @@ class Telemetry(BaseModel):
96107
Omit to capture without exporting.
97108
"""
98109

110+
storage: Optional[TelemetryStorage] = None
111+
"""Whether to persist this session's captured telemetry to Kernel storage."""
112+
99113

100114
class ManagedAuthBrowserConfig(BaseModel):
101115
"""

‎src/kernel/types/auth/managed_auth_browser_config_param.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"TelemetryExport",
1515
"TelemetryExportOtlp",
1616
"TelemetryExportOtlpDestination",
17+
"TelemetryStorage",
1718
]
1819

1920

@@ -61,6 +62,16 @@ class TelemetryExport(TypedDict, total=False):
6162
"""
6263

6364

65+
class TelemetryStorage(TypedDict, total=False):
66+
"""Whether to persist this session's captured telemetry to Kernel storage."""
67+
68+
enabled: bool
69+
"""Whether captured telemetry is persisted to Kernel storage.
70+
71+
Defaults to true. Setting false is not supported yet and is rejected.
72+
"""
73+
74+
6475
class Telemetry(TypedDict, total=False):
6576
"""Browser telemetry configuration using the same semantics as browser create."""
6677

@@ -97,6 +108,9 @@ class Telemetry(TypedDict, total=False):
97108
Omit to capture without exporting.
98109
"""
99110

111+
storage: TelemetryStorage
112+
"""Whether to persist this session's captured telemetry to Kernel storage."""
113+
100114

101115
class ManagedAuthBrowserConfigParam(TypedDict, total=False):
102116
"""

‎src/kernel/types/browser_create_params.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"TelemetryExport",
2222
"TelemetryExportOtlp",
2323
"TelemetryExportOtlpDestination",
24+
"TelemetryStorage",
2425
]
2526

2627

@@ -217,6 +218,16 @@ class TelemetryExport(TypedDict, total=False):
217218
"""
218219

219220

221+
class TelemetryStorage(TypedDict, total=False):
222+
"""Whether to persist this session's captured telemetry to Kernel storage."""
223+
224+
enabled: bool
225+
"""Whether captured telemetry is persisted to Kernel storage.
226+
227+
Defaults to true. Setting false is not supported yet and is rejected.
228+
"""
229+
230+
220231
class Telemetry(TypedDict, total=False):
221232
"""Telemetry configuration for the browser session.
222233
@@ -255,3 +266,6 @@ class Telemetry(TypedDict, total=False):
255266
256267
Omit to capture without exporting.
257268
"""
269+
270+
storage: TelemetryStorage
271+
"""Whether to persist this session's captured telemetry to Kernel storage."""

‎src/kernel/types/browser_pool_acquire_params.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"TelemetryExport",
1616
"TelemetryExportOtlp",
1717
"TelemetryExportOtlpDestination",
18+
"TelemetryStorage",
1819
]
1920

2021

@@ -112,6 +113,16 @@ class TelemetryExport(TypedDict, total=False):
112113
"""
113114

114115

116+
class TelemetryStorage(TypedDict, total=False):
117+
"""Whether to persist this session's captured telemetry to Kernel storage."""
118+
119+
enabled: bool
120+
"""Whether captured telemetry is persisted to Kernel storage.
121+
122+
Defaults to true. Setting false is not supported yet and is rejected.
123+
"""
124+
125+
115126
class Telemetry(TypedDict, total=False):
116127
"""Telemetry override for the acquired browser, applied to this lease only.
117128
@@ -150,3 +161,6 @@ class Telemetry(TypedDict, total=False):
150161
151162
Omit to capture without exporting.
152163
"""
164+
165+
storage: TelemetryStorage
166+
"""Whether to persist this session's captured telemetry to Kernel storage."""

‎src/kernel/types/browser_pool_create_params.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"TelemetryExport",
1919
"TelemetryExportOtlp",
2020
"TelemetryExportOtlpDestination",
21+
"TelemetryStorage",
2122
]
2223

2324

@@ -209,6 +210,16 @@ class TelemetryExport(TypedDict, total=False):
209210
"""
210211

211212

213+
class TelemetryStorage(TypedDict, total=False):
214+
"""Whether to persist this session's captured telemetry to Kernel storage."""
215+
216+
enabled: bool
217+
"""Whether captured telemetry is persisted to Kernel storage.
218+
219+
Defaults to true. Setting false is not supported yet and is rejected.
220+
"""
221+
222+
212223
class Telemetry(TypedDict, total=False):
213224
"""Telemetry configuration applied to browsers warmed into this pool.
214225
@@ -247,3 +258,6 @@ class Telemetry(TypedDict, total=False):
247258
248259
Omit to capture without exporting.
249260
"""
261+
262+
storage: TelemetryStorage
263+
"""Whether to persist this session's captured telemetry to Kernel storage."""

0 commit comments

Comments
 (0)