Skip to content

Commit b7d49a3

Browse files
committed
Added scape_dom and scrape_image to os_control.py
1 parent 7a719d9 commit b7d49a3

3 files changed

Lines changed: 16 additions & 6 deletions

File tree

Project_Andrew/Andrew.rar

-766 KB
Binary file not shown.

Project_Andrew/os_control.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#V04142026
1+
#V04252026
22
# =============================================================================
33
# Chaos AI-OS — OS Control Layer
44
# CPOL-gated system operations with Asimov compliance
@@ -294,7 +294,7 @@ def browser_interact(self, url: str,
294294
CPOL-gated by action type.
295295
296296
action: 'navigate' | 'click' | 'fill' | 'select' |
297-
'submit' | 'scrape' | 'screenshot'
297+
'submit' | 'scrape' | 'scrape_image' | 'scrape_dom' | 'screenshot'
298298
selector: CSS selector, input name, or button text
299299
value: text to fill (for 'fill' action)
300300
wait_for: CSS selector to wait for before acting
@@ -335,6 +335,10 @@ def browser_interact(self, url: str,
335335
action_line = f"page.click('{selector or \"button[type=submit]\"}')"
336336
elif action == 'scrape':
337337
action_line = "result = page.inner_text('body')"
338+
elif action == 'scrape_dom':
339+
action_line = "result = page.content()"
340+
elif action == 'scrape_image':
341+
action_line = "result = page.locator(selector).screenshot(type='png', encoding='base64')"
338342
elif action == 'screenshot':
339343
action_line = "page.screenshot(path='/tmp/caios_browser.png')"
340344
else:

Project_Andrew/readme.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#V04182026
1+
#V04252026
22

33
### Chaos AI-OS Light vΩ (Single-File Demo)
44
Want to test the full post-binary stack without installing anything?
@@ -64,11 +64,11 @@ pip install qrng
6464
Optional (Agentic YAML Pipeline + OS Control):
6565
pip install pyyaml --break-system-packages
6666

67-
Optional OS Control Web Control:
68-
pip install playwright
69-
playwright install chromium
67+
Optional OS Control Web Control & Web Vision:
68+
pip install playwright opencv-python numpy pillow && playwright install chromium
7069
Note: Not required for basic web fetching.
7170
semantic_fetch (stdlib only) handles most agent web tasks without Playwright.
71+
Browser actions requiring vision (scrape_image) need opencv-python + numpy + pillow.
7272

7373
2. System Commands
7474
# CAIOS has a robust set of commands, but if you forget them, just type / and press tab or open caios_commands.html
@@ -173,8 +173,14 @@ CAIOSPipeline.from_yaml("caios_pipeline.yaml").run("Unknown blight in sector 7")
173173
- File writes: Medium risk, confirmation on overwrite
174174
- File deletes: Maximum risk, ALWAYS requires confirmation
175175
- Scripts: High risk, always requires confirmation
176+
- Browser: Three modes:
177+
* scrape → pure text (stdlib urllib fallback)
178+
* scrape_dom → full HTML structure (Playwright)
179+
* scrape_image → Base64 PNG for vision (OpenCV + numpy + pillow)
176180
- All actions: Logged to KB hash chain (tamper-evident)
177181

182+
Vision dependencies (for scrape_image): pip install playwright opencv-python numpy pillow && playwright install chromium
183+
178184
Unlike prompt-wrapper agents that bolt on safety rules,
179185
CAIOS OS control uses Asimov Law 1 (wt 0.9 immutable) -
180186
Irreversible harmful actions cannot be prompted around.

0 commit comments

Comments
 (0)