sentienceapi 0.90.12__py3-none-any.whl → 0.90.16__py3-none-any.whl

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.

Potentially problematic release.


This version of sentienceapi might be problematic. Click here for more details.

sentience/__init__.py CHANGED
@@ -70,7 +70,7 @@ from .utils import (
70
70
  )
71
71
  from .wait import wait_for
72
72
 
73
- __version__ = "0.90.12"
73
+ __version__ = "0.90.16"
74
74
 
75
75
  __all__ = [
76
76
  # Core SDK
@@ -0,0 +1,40 @@
1
+ """
2
+ Shared extension loading logic for sync and async implementations
3
+ """
4
+
5
+ from pathlib import Path
6
+
7
+
8
+ def find_extension_path() -> Path:
9
+ """
10
+ Find Sentience extension directory (shared logic for sync and async).
11
+
12
+ Checks multiple locations:
13
+ 1. sentience/extension/ (installed package)
14
+ 2. ../sentience-chrome (development/monorepo)
15
+
16
+ Returns:
17
+ Path to extension directory
18
+
19
+ Raises:
20
+ FileNotFoundError: If extension not found in any location
21
+ """
22
+ # 1. Try relative to this file (installed package structure)
23
+ # sentience/_extension_loader.py -> sentience/extension/
24
+ package_ext_path = Path(__file__).parent / "extension"
25
+
26
+ # 2. Try development root (if running from source repo)
27
+ # sentience/_extension_loader.py -> ../sentience-chrome
28
+ dev_ext_path = Path(__file__).parent.parent.parent / "sentience-chrome"
29
+
30
+ if package_ext_path.exists() and (package_ext_path / "manifest.json").exists():
31
+ return package_ext_path
32
+ elif dev_ext_path.exists() and (dev_ext_path / "manifest.json").exists():
33
+ return dev_ext_path
34
+ else:
35
+ raise FileNotFoundError(
36
+ f"Extension not found. Checked:\n"
37
+ f"1. {package_ext_path}\n"
38
+ f"2. {dev_ext_path}\n"
39
+ "Make sure the extension is built and 'sentience/extension' directory exists."
40
+ )
sentience/agent.py CHANGED
@@ -149,23 +149,8 @@ class SentienceAgent(BaseAgent):
149
149
  if snap_opts.goal is None:
150
150
  snap_opts.goal = goal
151
151
 
152
- # Convert screenshot config to dict if needed
153
- screenshot_param = snap_opts.screenshot
154
- if isinstance(snap_opts.screenshot, ScreenshotConfig):
155
- screenshot_param = {
156
- "format": snap_opts.screenshot.format,
157
- "quality": snap_opts.screenshot.quality,
158
- }
159
-
160
- # Call snapshot with converted parameters
161
- snap = snapshot(
162
- self.browser,
163
- screenshot=screenshot_param,
164
- limit=snap_opts.limit,
165
- filter=snap_opts.filter.model_dump() if snap_opts.filter else None,
166
- use_api=snap_opts.use_api,
167
- goal=snap_opts.goal, # Pass goal to snapshot
168
- )
152
+ # Call snapshot with options object (matches TypeScript API)
153
+ snap = snapshot(self.browser, snap_opts)
169
154
 
170
155
  if snap.status != "success":
171
156
  raise RuntimeError(f"Snapshot failed: {snap.error}")