sentienceapi 0.92.0 → 0.92.2

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 (45) hide show
  1. package/dist/agent.d.ts.map +1 -1
  2. package/dist/agent.js +2 -1
  3. package/dist/agent.js.map +1 -1
  4. package/dist/browser.d.ts +18 -1
  5. package/dist/browser.d.ts.map +1 -1
  6. package/dist/browser.js +23 -1
  7. package/dist/browser.js.map +1 -1
  8. package/dist/index.d.ts +1 -0
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +3 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/tracing/tracer-factory.d.ts +13 -0
  13. package/dist/tracing/tracer-factory.d.ts.map +1 -1
  14. package/dist/tracing/tracer-factory.js +14 -2
  15. package/dist/tracing/tracer-factory.js.map +1 -1
  16. package/dist/tracing/tracer.d.ts +18 -1
  17. package/dist/tracing/tracer.d.ts.map +1 -1
  18. package/dist/tracing/tracer.js +23 -1
  19. package/dist/tracing/tracer.js.map +1 -1
  20. package/dist/tracing/types.d.ts +1 -0
  21. package/dist/tracing/types.d.ts.map +1 -1
  22. package/dist/utils/element-filter.d.ts.map +1 -1
  23. package/dist/utils/element-filter.js +7 -3
  24. package/dist/utils/element-filter.js.map +1 -1
  25. package/dist/utils/llm-interaction-handler.d.ts +3 -1
  26. package/dist/utils/llm-interaction-handler.d.ts.map +1 -1
  27. package/dist/utils/llm-interaction-handler.js +89 -18
  28. package/dist/utils/llm-interaction-handler.js.map +1 -1
  29. package/dist/utils/trace-event-builder.d.ts.map +1 -1
  30. package/dist/utils/trace-event-builder.js +34 -0
  31. package/dist/utils/trace-event-builder.js.map +1 -1
  32. package/dist/visual-agent.d.ts +115 -0
  33. package/dist/visual-agent.d.ts.map +1 -0
  34. package/dist/visual-agent.js +747 -0
  35. package/dist/visual-agent.js.map +1 -0
  36. package/package.json +1 -1
  37. package/src/extension/background.js +56 -185
  38. package/src/extension/content.js +117 -289
  39. package/src/extension/injected_api.js +799 -1374
  40. package/src/extension/manifest.json +1 -1
  41. package/src/extension/pkg/README.md +136 -19
  42. package/src/extension/pkg/sentience_core.js +190 -396
  43. package/src/extension/pkg/sentience_core_bg.wasm +0 -0
  44. package/src/extension/release.json +47 -47
  45. package/src/extension/test-content.js +0 -4
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Sentience Semantic Visual Grounding Extractor",
4
- "version": "2.0.7",
4
+ "version": "2.2.0",
5
5
  "description": "Extract semantic visual grounding data from web pages",
6
6
  "permissions": ["activeTab", "scripting"],
7
7
  "host_permissions": ["<all_urls>"],
@@ -10,18 +10,19 @@ Perfect for AI agents, automation scripts, visual grounding, and accessibility t
10
10
 
11
11
  1. [Overview](#overview)
12
12
  2. [Quick Start](#quick-start)
13
- 3. [Installation](#installation)
14
- 4. [User API](#user-api)
15
- 5. [Usage Examples](#usage-examples)
16
- 6. [Screenshot Feature](#screenshot-feature)
17
- 7. [Bounding Box Visualization](#bounding-box-visualization)
18
- 8. [Filtering & Ranking](#filtering--ranking)
19
- 9. [Architecture](#architecture)
20
- 10. [Implementation Details](#implementation-details)
21
- 11. [API Reference](#api-reference)
22
- 12. [Performance](#performance)
23
- 13. [Troubleshooting](#troubleshooting)
24
- 14. Transferred to SentienceAPI Org
13
+ 3. [Developer Quick Reference](#developer-quick-reference)
14
+ 4. [Installation](#installation)
15
+ 5. [User API](#user-api)
16
+ 6. [Usage Examples](#usage-examples)
17
+ 7. [Screenshot Feature](#screenshot-feature)
18
+ 8. [Bounding Box Visualization](#bounding-box-visualization)
19
+ 9. [Filtering & Ranking](#filtering--ranking)
20
+ 10. [Architecture](#architecture)
21
+ 11. [Implementation Details](#implementation-details)
22
+ 12. [API Reference](#api-reference)
23
+ 13. [Performance](#performance)
24
+ 14. [Troubleshooting](#troubleshooting)
25
+ 15. [Contributing](#contributing)
25
26
 
26
27
  ---
27
28
 
@@ -59,14 +60,16 @@ Extracts a **geometry map** of any webpage:
59
60
  ### 5-Second Test
60
61
 
61
62
  ```bash
62
- # Build WASM
63
- cd Claude
64
- wasm-pack build --target web
63
+ # 1. Install dependencies
64
+ npm install
65
+
66
+ # 2. Build extension (WASM + JavaScript)
67
+ npm run build
65
68
 
66
- # Load extension in Chrome
67
- # chrome://extensions → Load unpacked → Select Claude/ directory
69
+ # 3. Load extension in Chrome
70
+ # chrome://extensions → Enable Developer mode → Load unpacked → Select this directory
68
71
 
69
- # Open any webpage, then in DevTools Console:
72
+ # 4. Open any webpage, then in DevTools Console:
70
73
  ```
71
74
 
72
75
  ```javascript
@@ -78,6 +81,67 @@ console.log(result.elements);
78
81
 
79
82
  ---
80
83
 
84
+ ## Developer Quick Reference
85
+
86
+ ### 📦 **Build Commands**
87
+
88
+ | Command | What it does |
89
+ |---------|-------------|
90
+ | `npm install` | Install dependencies (first time only) |
91
+ | `npm run build` | **Full build** (WASM + JavaScript bundles) |
92
+ | `npm run build:wasm` | Build only WASM (Rust → pkg/) |
93
+ | `npm run build:bundle` | Build only JavaScript (src/ → dist/) |
94
+
95
+ ### ✅ **Code Quality**
96
+
97
+ | Command | What it does |
98
+ |---------|-------------|
99
+ | `npm run lint` | Check code quality with ESLint |
100
+ | `npm run lint:fix` | Auto-fix linting issues |
101
+ | `npm run format` | Format code with Prettier |
102
+ | `npm run format:check` | Check code formatting |
103
+
104
+ ### 🧪 **Testing**
105
+
106
+ | Command | What it does |
107
+ |---------|-------------|
108
+ | `npm test` | Run all tests with coverage |
109
+ | `npm run test:watch` | Run tests in watch mode |
110
+ | `npm run test:coverage` | Generate coverage report |
111
+
112
+ ### 📁 **Project Structure**
113
+
114
+ ```
115
+ sentience-chrome/
116
+ ├── src/ # Modular source code
117
+ │ ├── background/ # Service worker with WASM
118
+ │ ├── content/ # Message bridge
119
+ │ └── injected/ # Main API (7 modules)
120
+ ├── tests/ # Unit tests (76 tests)
121
+ ├── dist/ # Bundled output (gitignored)
122
+ ├── pkg/ # WASM artifacts (gitignored)
123
+ └── docs/ # Documentation
124
+ ```
125
+
126
+ ### 🔄 **Development Workflow**
127
+
128
+ ```bash
129
+ # 1. Make changes to src/injected/utils.js (for example)
130
+ # 2. Rebuild JavaScript (fast)
131
+ npm run build:bundle
132
+
133
+ # 3. Reload extension in Chrome
134
+ # Click refresh icon in chrome://extensions/
135
+ ```
136
+
137
+ ### 📚 **Documentation**
138
+
139
+ - **[CONTRIBUTING.md](CONTRIBUTING.md)** - Developer guide
140
+ - **[docs/RESTRUCTURING_PROGRESS.md](docs/RESTRUCTURING_PROGRESS.md)** - Architecture overview
141
+ - **[docs/RESTRUCTURING_ASSESSMENT.md](docs/RESTRUCTURING_ASSESSMENT.md)** - Planning document
142
+
143
+ ---
144
+
81
145
  ## Installation
82
146
 
83
147
  ### Prerequisites
@@ -1220,4 +1284,57 @@ if __name__ == "__main__":
1220
1284
 
1221
1285
  1. **Zero Network Latency:** The Python script talks to the Extension instantly via the Chrome DevTools Protocol. No HTTP requests to your server.
1222
1286
  2. **Shared State:** The Python script can see the `window.sentience` object just like a developer typing in the console.
1223
- 3. **Hybrid Control:** You can mix your `sentience.snapshot()` (for vision) with standard Playwright commands (like `.type()` or `.waitForNavigation()`) for a robust agent.
1287
+ 3. **Hybrid Control:** You can mix your `sentience.snapshot()` (for vision) with standard Playwright commands (like `.type()` or `.waitForNavigation()`) for a robust agent.
1288
+ ---
1289
+
1290
+ ## Contributing
1291
+
1292
+ We welcome contributions! This extension has been fully restructured with modern tooling and modular architecture.
1293
+
1294
+ ### 🚀 **Quick Start for Contributors**
1295
+
1296
+ 1. **Clone and install:**
1297
+ ```bash
1298
+ git clone https://github.com/YOUR_ORG/sentience-chrome.git
1299
+ cd sentience-chrome
1300
+ npm install
1301
+ ```
1302
+
1303
+ 2. **Make changes** to the modular source in `src/`
1304
+
1305
+ 3. **Test your changes:**
1306
+ ```bash
1307
+ npm run lint # Check code quality
1308
+ npm test # Run tests
1309
+ npm run build # Build extension
1310
+ ```
1311
+
1312
+ 4. **Submit a PR** - CI will automatically check linting, tests, and builds
1313
+
1314
+ ### 📚 **Developer Resources**
1315
+
1316
+ - **[CONTRIBUTING.md](CONTRIBUTING.md)** - Complete developer guide
1317
+ - **[docs/RESTRUCTURING_PROGRESS.md](docs/RESTRUCTURING_PROGRESS.md)** - Architecture details
1318
+ - **Modular codebase** - 7 focused modules instead of monolith
1319
+ - **76 tests** with 80% pass rate
1320
+ - **Automated CI/CD** - GitHub Actions for quality checks
1321
+
1322
+ ### 🎯 **Key Features for Contributors**
1323
+
1324
+ - ✅ **ESLint + Prettier** - Automated code quality
1325
+ - ✅ **Jest testing** - Unit tests with coverage reports
1326
+ - ✅ **Rollup bundling** - Optimized builds
1327
+ - ✅ **CI/CD pipelines** - Automated checks on every PR
1328
+ - ✅ **Zero breaking changes** - SDK compatibility preserved
1329
+
1330
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
1331
+
1332
+ ---
1333
+
1334
+ ## License
1335
+
1336
+ See [LICENSE](LICENSE) file.
1337
+
1338
+ ---
1339
+
1340
+ **Built with ❤️ for AI agents and web automation**