webfuse-nightly 0.1.0.dev202611271351__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. webfuse_nightly-0.1.0.dev202611271351/.gitignore +9 -0
  2. webfuse_nightly-0.1.0.dev202611271351/LICENSE +21 -0
  3. webfuse_nightly-0.1.0.dev202611271351/PKG-INFO +454 -0
  4. webfuse_nightly-0.1.0.dev202611271351/README.md +440 -0
  5. webfuse_nightly-0.1.0.dev202611271351/pyproject.toml +60 -0
  6. webfuse_nightly-0.1.0.dev202611271351/src/webfuse/__init__.py +86 -0
  7. webfuse_nightly-0.1.0.dev202611271351/src/webfuse/_batch.py +220 -0
  8. webfuse_nightly-0.1.0.dev202611271351/src/webfuse/_client.py +313 -0
  9. webfuse_nightly-0.1.0.dev202611271351/src/webfuse/_errors.py +196 -0
  10. webfuse_nightly-0.1.0.dev202611271351/src/webfuse/_extensions.py +298 -0
  11. webfuse_nightly-0.1.0.dev202611271351/src/webfuse/_generated/__init__.py +37 -0
  12. webfuse_nightly-0.1.0.dev202611271351/src/webfuse/_generated/rest.py +3033 -0
  13. webfuse_nightly-0.1.0.dev202611271351/src/webfuse/_generated/tools.py +1837 -0
  14. webfuse_nightly-0.1.0.dev202611271351/src/webfuse/_launcher.py +355 -0
  15. webfuse_nightly-0.1.0.dev202611271351/src/webfuse/_log.py +39 -0
  16. webfuse_nightly-0.1.0.dev202611271351/src/webfuse/_mcp.py +169 -0
  17. webfuse_nightly-0.1.0.dev202611271351/src/webfuse/_protocols.py +63 -0
  18. webfuse_nightly-0.1.0.dev202611271351/src/webfuse/_results.py +70 -0
  19. webfuse_nightly-0.1.0.dev202611271351/src/webfuse/_server_build.py +29 -0
  20. webfuse_nightly-0.1.0.dev202611271351/src/webfuse/_sessions.py +1095 -0
  21. webfuse_nightly-0.1.0.dev202611271351/src/webfuse/_spaces.py +324 -0
  22. webfuse_nightly-0.1.0.dev202611271351/src/webfuse/_transport.py +156 -0
  23. webfuse_nightly-0.1.0.dev202611271351/src/webfuse/_unset.py +16 -0
  24. webfuse_nightly-0.1.0.dev202611271351/src/webfuse/_wire.py +36 -0
  25. webfuse_nightly-0.1.0.dev202611271351/src/webfuse/py.typed +0 -0
@@ -0,0 +1,9 @@
1
+ __pycache__/
2
+ *.egg-info/
3
+ .venv/
4
+ .pytest_cache/
5
+ .ruff_cache/
6
+ dist/
7
+ build/
8
+ reports/
9
+ .claude/worktrees/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Surfly B.V.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,454 @@
1
+ Metadata-Version: 2.5
2
+ Name: webfuse-nightly
3
+ Version: 0.1.0.dev202611271351
4
+ Summary: Python SDK for Webfuse: Spaces, extensions and session automation
5
+ Project-URL: Source, https://github.com/surfly/webfuse-python
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.11
9
+ Requires-Dist: anyio>=4.9
10
+ Requires-Dist: httpx2<3,>=2.10
11
+ Requires-Dist: mcp<3,>=2.3
12
+ Requires-Dist: typing-extensions>=4.13
13
+ Description-Content-Type: text/markdown
14
+
15
+ # webfuse
16
+
17
+ > **webfuse-nightly 0.1.0.dev202611271351**, built from webfuse-python commit b767823934, generated from Webfuse v5.99+ on webfu.se (commit 0294071ffc, 2026-11-26).
18
+ >
19
+ > This is the nightly build of `webfuse` from Webfuse's develop environment. It installs the same `webfuse` module, so uninstall `webfuse` before you install it, and the other way round.
20
+
21
+ The Python SDK for [Webfuse](https://www.webfuse.com/). Create Spaces, upload extensions, start sessions and drive
22
+ them with the tools an AI agent gets from Webfuse's [Session MCP server](https://dev.webfuse.com/session-mcp-server/):
23
+ open pages, click, type, read the page as text or as a screenshot, and call the tools your own extensions add.
24
+
25
+ ```python
26
+ import asyncio
27
+
28
+ from webfuse import Webfuse
29
+
30
+
31
+ async def main():
32
+ async with Webfuse(api_key="ak_...") as wf, wf.sessions.start() as session: # opens Chrome
33
+ await session.navigate("https://example.com")
34
+ print(await session.page_info()) # PageInfo(url='https://example.com/', title='Example Domain')
35
+
36
+
37
+ asyncio.run(main())
38
+ ```
39
+
40
+ The SDK is async (asyncio), fully typed, and needs Python 3.11 or later.
41
+
42
+ ## Install
43
+
44
+ ```sh
45
+ pip install webfuse
46
+ ```
47
+
48
+ | Package | Install | What it is |
49
+ |---|---|---|
50
+ | `webfuse` | `pip install webfuse` | Releases, each tested against webfuse.com. |
51
+ | `webfuse` pre-releases | `pip install --pre webfuse` | Release candidates, tested against the next Webfuse release before it reaches webfuse.com. |
52
+ | `webfuse-nightly` | `pip install webfuse-nightly` | Development builds that follow Webfuse's development version, so they can offer tools webfuse.com does not have yet. |
53
+
54
+ All three install the same `webfuse` module: install only one of them, and uninstall it before you switch.
55
+
56
+ Starting a session opens it in a local browser: Chrome or Chromium (the default) or Firefox. Install one of them, or
57
+ open the session link yourself (see Sessions below).
58
+
59
+ ## API keys
60
+
61
+ The key you give the client decides what it can reach:
62
+
63
+ | Key | Where it comes from | What the client can do |
64
+ |---|---|---|
65
+ | Company key, `ck_…` | Company → Developers → API | Create, find and delete every Space of the company with `wf.spaces`, and manage their keys, extensions and sessions. |
66
+ | Space REST key, `rk_…` | The Space's REST API key, or `await space.keys.create("rk")` | Sessions and extensions of its own Space: `wf.sessions` and `wf.extensions`. |
67
+ | Space Automation key, `ak_…` | Space → Apps → Automation | Sessions of its own Space: `wf.sessions`. |
68
+
69
+ The Automation key grants the least, so give it to agents. Webfuse's [REST API](https://dev.webfuse.com/rest-api/)
70
+ and [Automation API](https://dev.webfuse.com/automation-api/) docs describe the keys in more detail.
71
+
72
+ ## Quick start
73
+
74
+ ### Automate a Space with its Automation key
75
+
76
+ This script starts a session in the key's Space, opens a page, saves a screenshot and ends the session:
77
+
78
+ ```python
79
+ import asyncio
80
+
81
+ from webfuse import Webfuse
82
+
83
+
84
+ async def main():
85
+ async with Webfuse() as wf, wf.sessions.start() as session: # key and host from the environment
86
+ print("Session:", session.link)
87
+ await session.navigate("https://example.com")
88
+ print("Title:", (await session.page_info()).title)
89
+ saved = (await session.see.gui_snapshot()).save("screenshot")
90
+ print(saved, "saved")
91
+ print("Session ended")
92
+
93
+
94
+ asyncio.run(main())
95
+ ```
96
+
97
+ ```sh
98
+ WEBFUSE_API_KEY=ak_... WEBFUSE_HOST=webfuse.com python space_key.py
99
+ ```
100
+
101
+ ```text
102
+ Session: https://webfuse.com/spCXKOcP8JOQQzmI8mLlisLIuA
103
+ Title: Example Domain
104
+ screenshot.webp saved
105
+ Session ended
106
+ ```
107
+
108
+ ### From a Company key to a custom tool
109
+
110
+ This script creates a Space, uploads an extension that adds a `ping` tool to its sessions, calls the tool in a session
111
+ and deletes the Space again:
112
+
113
+ ```python
114
+ import asyncio
115
+ import secrets
116
+
117
+ from webfuse import Webfuse
118
+
119
+ PING_JS = """
120
+ browser.webfuseSession.tools.registerTool({
121
+ name: "ping",
122
+ description: "Answer with pong and echo the message",
123
+ inputSchema: {type: "object", properties: {message: {type: "string"}}},
124
+ execute: async ({message}) => `pong: ${message ?? ""}`,
125
+ });
126
+ """
127
+
128
+ PING_EXTENSION = {
129
+ "manifest.json": { # a dict is written as JSON
130
+ "manifest_version": 3,
131
+ "name": "Ping",
132
+ "background": {"service_worker": "background.js"},
133
+ "tools": [ # declared, so the session lists the tool before the extension registers it
134
+ {
135
+ "name": "ping",
136
+ "description": "Answer with pong and echo the message",
137
+ "inputSchema": {"type": "object", "properties": {"message": {"type": "string"}}},
138
+ }
139
+ ],
140
+ },
141
+ "background.js": PING_JS,
142
+ }
143
+
144
+
145
+ async def main():
146
+ async with Webfuse() as wf: # WEBFUSE_API_KEY=ck_...
147
+ space = await wf.spaces.create("Ping demo", slug=f"ping-demo-{secrets.token_hex(3)}")
148
+ print("Space:", space.link)
149
+ try:
150
+ ext = await space.extensions.upload(PING_EXTENSION)
151
+ print("Extension:", ext.name)
152
+ async with space.sessions.start() as session:
153
+ result = await session.tool("ping", {"message": "hello"})
154
+ print(result.text) # pong: hello
155
+ finally:
156
+ await space.delete()
157
+ print("Space deleted")
158
+
159
+
160
+ asyncio.run(main())
161
+ ```
162
+
163
+ How extensions register tools and what else they can do: Webfuse's
164
+ [Extension API](https://dev.webfuse.com/extension-api/).
165
+
166
+ ## The client
167
+
168
+ ```python
169
+ from webfuse import Webfuse
170
+
171
+ async with Webfuse(api_key="ck_...", host="webfuse.com") as wf:
172
+ ...
173
+ ```
174
+
175
+ - **`api_key`:** one of the keys above; default: the environment variable `WEBFUSE_API_KEY`.
176
+ - **`host`:** the host your Spaces run on, such as `webfuse.com` or your company's own domain; a name, not a URL.
177
+ Default: `WEBFUSE_HOST`, else `webfuse.com`.
178
+ - **Closing:** leaving `async with` (or `await wf.close()`) closes the client's open sessions by their rules (see
179
+ Sessions below), then its connections.
180
+
181
+ Every call takes `timeout=` in seconds, and `None` waits without a limit. Without it, the client's defaults apply:
182
+
183
+ | Option | Default | Limits |
184
+ |---|---|---|
185
+ | `connect_timeout` | 10 | Opening a connection. |
186
+ | `request_timeout` | 30 | Each REST request: Spaces, keys, extensions. |
187
+ | `start_timeout` | 90 | Starting or attaching to a session; no limit when `start(browser=None)` waits for a person. |
188
+ | `tool_timeout` | 330 | Each tool call in a session, and a whole batch. |
189
+ | `cleanup_timeout` | 15 | Closing sessions and the client, in total. |
190
+
191
+ `verify_tls=False` is only for a test server with a self-signed certificate.
192
+
193
+ ## Spaces
194
+
195
+ With a Company key:
196
+
197
+ ```python
198
+ space = await wf.spaces.create("Support", slug="support") # type="solo" (default), "assisted" or "meeting"
199
+ space = await wf.spaces.get("support") # by slug, or by numeric id
200
+ for each in await wf.spaces.list():
201
+ print(each.id, each.slug, each.link)
202
+ await space.delete()
203
+ ```
204
+
205
+ A new Space gets the Automation app, which creates its Automation key (`automation=False` leaves it out). A Space has
206
+ `id`, `slug`, `name`, `type`, `link` and `domain`, and `space.keys`, `space.extensions` and `space.sessions` work on it.
207
+
208
+ A Space on your company's subdomain or custom domain answers only on that domain. The SDK sends that Space's calls
209
+ there, with the same key, so you do not need a client per domain.
210
+
211
+ ### Space keys
212
+
213
+ ```python
214
+ keys = await space.keys.list() # [SpaceKey(type='ak', key=ak_…KIfP)]
215
+ ak = await space.keys.get("ak") # or None
216
+ rk = await space.keys.create("rk") # ValidationError when the Space already has one
217
+ print(rk.key) # the value; repr() masks it
218
+ rk = await rk.rotate() # a new value; the old one stops working for REST at once
219
+ await rk.delete()
220
+ ```
221
+
222
+ Managing keys needs a Company key. Sessions of a Space use its Automation key, which the SDK reads with the Company
223
+ key, so `space.sessions` works without you handling it.
224
+
225
+ ## Extensions
226
+
227
+ ```python
228
+ ext = await space.extensions.upload("./my-extension") # a folder, a .zip file, ZIP bytes or a {path: content} dict
229
+ for each in await space.extensions.list():
230
+ print(each.id, each.name)
231
+ ext = await space.extensions.get(ext.id)
232
+ ext = await space.extensions.get_by_name("Ping") # or None
233
+ ext = await ext.update("./my-extension") # new files, same extension
234
+ await ext.delete()
235
+ ```
236
+
237
+ - **Before uploading,** the SDK checks the source and raises `UsageError` without sending anything: `manifest.json` at
238
+ the root, with an integer `manifest_version` and a `name`; every file it names present; no paths that leave the
239
+ folder, no symlinks, no duplicate ZIP entries.
240
+ - **`update()`** keeps the values stored in the extension's environment variables and adds new variables;
241
+ `keep_env=False` replaces the values with those in the new manifest.
242
+ - **Storage:** Webfuse keeps extension files in the Space's storage app. `upload(storage=…, directory=…)` picks
243
+ another storage app or a folder in it.
244
+ - **Keys:** a Company key (`space.extensions`) or the Space's REST key (`wf.extensions`). The Automation key may not
245
+ manage extensions, nor refresh or remove them in a session.
246
+
247
+ A running session keeps the version it loaded. To change that:
248
+
249
+ ```python
250
+ await session.extensions.refresh(ext) # load the new version; tabs its content scripts run in reload
251
+ await session.extensions.remove(ext) # unload it from this session only
252
+ ```
253
+
254
+ ## Sessions
255
+
256
+ | Call | What it does | Leaving `async with` or `close()` |
257
+ |---|---|---|
258
+ | `space.sessions.start()` | Creates a session, opens it in a local browser and waits until its tab answers. | Ends the session and stops the browser. |
259
+ | `space.sessions.create()` | Creates a session and returns its `SessionInfo` (`id`, `link`), without connecting or opening a browser. | — |
260
+ | `space.sessions.attach(session_id)` | Connects to a running session. | Disconnects; the session keeps running. |
261
+ | `space.sessions.end(session_id)` | Ends any session of the Space. | — |
262
+
263
+ With a Space key, use `wf.sessions` instead of `space.sessions`.
264
+
265
+ ```python
266
+ async with space.sessions.start() as session: # ends the session on exit
267
+ print(session.id, session.link)
268
+
269
+ session = await space.sessions.start() # without async with: close it yourself
270
+ try:
271
+ ...
272
+ finally:
273
+ await session.close()
274
+ ```
275
+
276
+ - **`start(browser=…)`:** `"chrome"` (the default), `"firefox"`, a `LocalBrowser` with options (see
277
+ Browsers below), or `None` to open nothing and wait, without a time limit, until someone opens
278
+ `session.link`. The SDK logs the link at INFO (`WEBFUSE_LOG=info` shows it).
279
+ - **To hand out a link yourself,** call `info = await space.sessions.create()`, send `info.link`, and later
280
+ `await space.sessions.attach(info.id)`.
281
+ - **`start(cleanup=False)`** leaves the session running when the handle closes. `session.end()` always ends it,
282
+ whoever created it.
283
+ - **`metadata={...}`** on `start()` and `create()` is sent with the session's activation; see the
284
+ [Automation API](https://dev.webfuse.com/automation-api/).
285
+
286
+ ## Driving a session
287
+
288
+ `session.act.*` changes the page, `session.see.*` reads it, and each method is one Session MCP tool:
289
+
290
+ ```python
291
+ await session.navigate("https://example.com")
292
+ info = await session.page_info() # PageInfo(url='https://example.com/', title='Example Domain')
293
+
294
+ text = await session.see.dom_snapshot() # the page as structured text
295
+ tree = await session.see.accessibility_tree() # the accessibility tree, as YAML
296
+ image = await session.see.gui_snapshot() # a screenshot
297
+ image.save("page") # page.webp
298
+ ```
299
+
300
+ On a page with a search form, for example:
301
+
302
+ ```python
303
+ await session.act.type("#search", "webfuse", overwrite=True)
304
+ await session.act.key_press("#search", "Enter")
305
+ await session.act.click("button.accept-cookies")
306
+ await session.act.upload_file("input[type=file]", "cv.pdf")
307
+ await session.act.highlight("#buy") # a frame around the element, for a person watching
308
+ ```
309
+
310
+ A **target** is a CSS selector, a Webfuse ID (`wf-id`) from a snapshot taken with `webfuse_ids=True`, a Webfuse
311
+ Locator, or `(x, y)` coordinates. Actions wait up to 3.5 seconds for their target to appear (`wait_for_target=`, in
312
+ seconds), and every duration is in seconds.
313
+
314
+ | Method | Tool | Returns |
315
+ |---|---|---|
316
+ | `navigate(url)` | `navigate` | `None` |
317
+ | `page_info()` | `pageInfo` | `PageInfo(url, title)` |
318
+ | `act.click(target, button=, double_click=, duration=)` | `act_click` | `None` |
319
+ | `act.type(target, text, overwrite=, follow_focus=)` | `act_type` | `None` |
320
+ | `act.key_press(target, key, ctrl_key=, alt_key=, shift_key=, meta_key=)` | `act_keyPress` | `None` |
321
+ | `act.mouse_move(target, persistent=)` | `act_mouseMove` | `None` |
322
+ | `act.scroll(target, amount, direction=)` | `act_scroll` | `None` |
323
+ | `act.select(target, value)` | `act_select` | `None` |
324
+ | `act.text_select(target, text, occurrence=)` | `act_textSelect` | `None` |
325
+ | `act.upload_file(target, *files)` | `act_uploadFile` | `None` |
326
+ | `act.highlight(target, duration=)` | `act_highlight` | `None` |
327
+ | `act.eval(code, context=, target_frame=)` | `act_eval` | `str` |
328
+ | `act.batch(steps, mode=, stop_on_error=)` | `act_batch` | `BatchResult` |
329
+ | `see.dom_snapshot(quality=, max_tokens=, root=, interactive_only=, webfuse_ids=, …)` | `see_domSnapshot` | `str` |
330
+ | `see.accessibility_tree(quality=, root=, representation=, …)` | `see_accessibilityTree` | `str` |
331
+ | `see.element_index(quality=, root=, representation=, …)` | `see_elementIndex` | `str` |
332
+ | `see.gui_snapshot(quality=, max_tokens=)` | `see_guiSnapshot` | `Image` |
333
+ | `see.text_selection()` | `see_textSelection` | `str` |
334
+ | `see.session_events(after=, before=, limit=, order=, types=)` | `see_sessionEvents` | `str` |
335
+
336
+ Each method's docstring has the server's description of the tool and its options, so `help(session.act.click)` or
337
+ your editor shows them. `upload_file` takes paths or `File(name, data)` objects, at most 5 MiB per call.
338
+
339
+ ### Custom tools
340
+
341
+ Tools that extensions add have no method of their own. Call them, and any other tool, by name:
342
+
343
+ ```python
344
+ await session.wait_for_tool("ping") # an extension can register its tool after the page loads
345
+ result = await session.tool("ping", {"message": "hi"})
346
+ print(result.text) # also result.json(), result.images, result.structured_content
347
+
348
+ for tool in await session.list_tools(): # every tool the session offers now, custom ones included
349
+ print(tool.name, tool.description, tool.input_schema)
350
+ ```
351
+
352
+ `list_tools()` returns each tool's name, description and input schema without the `session_id` parameter, ready to
353
+ hand to a model as its tool definitions.
354
+
355
+ ### Batches
356
+
357
+ A batch runs several tool calls in one request:
358
+
359
+ ```python
360
+ from webfuse import steps
361
+
362
+ result = await session.act.batch([steps.navigate("https://example.com"), steps.page_info(), steps.see.dom_snapshot()])
363
+ print(result[1].value.title) # each step's output, as the method returns it: here a PageInfo
364
+ ```
365
+
366
+ - **Steps:** `steps.navigate()`, `steps.page_info()`, `steps.act.*` and `steps.see.*` take the same arguments as the
367
+ methods; `steps.tool(name, arguments)` adds a custom tool. A batch has 1 to 50 steps.
368
+ - **`mode="serial"`** (the default) runs the steps in order and stops at the first failure (`stop_on_error=False`
369
+ goes on). `mode="parallel"` runs independent steps at once and does not take `navigate`.
370
+ - **Failures:** a failed step raises `BatchError`, whose `.result` holds every step's `status` (`ok`, `error`,
371
+ `skipped` or `cancelled`); `check=False` returns the `BatchResult` instead. One `timeout` covers the whole batch.
372
+
373
+ ## Errors
374
+
375
+ Tool methods return plain values and raise when a call fails. Every SDK exception is a `WebfuseError`:
376
+
377
+ | Exception | When |
378
+ |---|---|
379
+ | `UsageError` | The call cannot work as written, such as a missing key or an invalid extension; nothing was sent. |
380
+ | `AuthError` | 401: the key is missing, wrong or revoked. When the key is valid but the wrong kind, the message says which key works. |
381
+ | `PermissionDeniedError` | 403: the key may not do this. |
382
+ | `NotFoundError` | 404: no such Space, session, extension or key. |
383
+ | `ValidationError` | 400: the server rejected fields; `.fields` maps each field to its messages. |
384
+ | `APIError` | Any other error answer of the REST API; the base of the four above. `.status` and `.body` hold the answer. |
385
+ | `ToolError` | A session tool failed; `.tool` names it. `BatchError`, `StepSkippedError` and `UnsupportedFeatureError` are kinds of it. |
386
+ | `TimeoutError` | An SDK deadline passed. |
387
+ | `ConnectionError` | The server could not be reached, or the session's connection broke. |
388
+ | `SessionEndedError` | The session no longer exists. |
389
+ | `BrowserError` | No local browser was found or it could not start; `BrowserClosedError` when it exits during the session. |
390
+
391
+ `TimeoutError` and `ConnectionError` are also Python's built-in exceptions of those names, so existing handlers
392
+ catch them.
393
+
394
+ When a call that changes something times out or loses its connection, it may have run: check `outcome_unknown` before
395
+ you retry it. To get a failed tool call as data instead of an exception, pass `check=False`:
396
+
397
+ ```python
398
+ result = await session.act.click("#missing", wait_for_target=0, check=False)
399
+ if not result.ok:
400
+ print(result.error_info.code, result.error_info.message, result.error_info.tool_ran) # "yes", "no" or "unknown"
401
+ ```
402
+
403
+ ## Browsers
404
+
405
+ `start()` opens the session in a local browser with a temporary profile, which it removes when the session closes.
406
+ `LocalBrowser` sets the options:
407
+
408
+ ```python
409
+ from webfuse import LocalBrowser
410
+
411
+ browser = LocalBrowser("firefox", headless=True, window_size=(1440, 900))
412
+ async with space.sessions.start(browser=browser) as session:
413
+ ...
414
+ ```
415
+
416
+ - **Kinds:** `"chrome"` (Google Chrome or Chromium) and `"firefox"`, on Linux, macOS and Windows.
417
+ - **Finding the browser:** `LocalBrowser(path=...)`, then the environment variable `WEBFUSE_BROWSER_PATH`, then the
418
+ usual install folders (`/Applications` on macOS; `%ProgramFiles%`, `%ProgramFiles(x86)%` and `%LocalAppData%` on
419
+ Windows), then `PATH` (`google-chrome`, `chromium`, `firefox`, …).
420
+ - **Headless:** by default, visible on macOS and Windows, and on Linux headless when there is no display;
421
+ `headless=` decides. `args=` adds command-line flags.
422
+ - **Firefox:** `see.gui_snapshot()` fails, because Webfuse takes screenshots only in Chromium-based browsers.
423
+ - **In a container,** start it with an init process (`podman run --init`, `docker run --init`). Without one, the
424
+ browser's ended processes are never cleaned up, and closing a session waits its whole cleanup time.
425
+
426
+ ## Logging
427
+
428
+ The SDK logs to the `webfuse` logger. Set `WEBFUSE_LOG=debug` (or `info`, `warning`) to see every REST request and
429
+ tool call on stderr without changing your code. Log lines never contain keys, argument values, request bodies or
430
+ headers. When your application configures logging itself, the records go to its handlers instead.
431
+
432
+ ## Server versions
433
+
434
+ The SDK is generated from the tool and REST API descriptions of a Webfuse server. `webfuse.GENERATED_FROM` names it:
435
+
436
+ ```python
437
+ >>> import webfuse
438
+ >>> print(webfuse.GENERATED_FROM)
439
+ Webfuse v5.99+ on webfu.se (commit 0294071ffc, 2026-11-26)
440
+ ```
441
+
442
+ On PyPI, the first line of this page names it too. A server that runs an older Webfuse can lack a tool or an option this SDK
443
+ offers; calling it there fails with the server's error.
444
+
445
+ Known limitations on webfuse.com:
446
+
447
+ | What | Until it is fixed |
448
+ |---|---|
449
+ | `attach()` with an Automation key: the server does not let it read the session | Attach with the Space's REST key. |
450
+ | `session.extensions.refresh()` in a session the SDK opened answers 401 | Start a new session after `ext.update()`; `remove()` works. |
451
+
452
+ ## License
453
+
454
+ MIT. To work on the SDK itself, see `docs/development.md` in its source repository.