~/wiki

Novel Automation Techniques

Mis à jour le 2025-01-04Confiance : high
novel-automation-techniquesclaude-fable-5pyobjc-frameworkscreencapture-clitemplate-injectioncors-server-developmentwindow-enumerationbrowser-automationjavascript-injectionshadow-dom-navigationcross-domain-communicationautomation-inventivenesssystem-integrationdatasette-template-modificationkeyboard-simulationweb-component-debuggingreal-browser-controlundocumented-patterns

Previously undocumented automation patterns invented autonomously by AI agents, particularly claude-fable 5, demonstrating frontier capabilities in system integration and creative problem-solving. These techniques represent emergent behaviors not found in existing documentation or training materials.

Window Enumeration and Targeting

PyObjC-Framework-Quartz Integration: Using uv run --with pyobjc-framework-Quartz to iterate through all available macOS windows, filtering for specific applications and content patterns. Enables precise window targeting by extracting window numbers (e.g., 153551) for use with system tools.

Screenshot Automation: Combining window enumeration with screencapture -x -o -l [window_id] [output.png] to capture specific browser windows without traditional automation frameworks.

Real Browser Control Without Frameworks

Template Modification Approach: Editing application templates to inject JavaScript that simulates user interactions:

window.addEventListener("load", function () {
  setTimeout(function () {
    document.dispatchEvent(new KeyboardEvent("keydown", {key: "/", bubbles: true}));
  }, 1200);
});

Shadow DOM Navigation: Direct manipulation of Web Component internals to extract measurements and data:

const host = document.querySelector("navigation-search");
const ta = host.shadowRoot.querySelector("textarea");
const cs = getComputedStyle(ta);

Cross-Domain Data Capture

Custom CORS Servers: Minimal HTTP servers using Python's standard library to capture JSON data from browser-executed JavaScript:

from http.server import HTTPServer, BaseHTTPRequestHandler

class H(BaseHTTPRequestHandler):
    def do_POST(self):
        n = int(self.headers.get("Content-Length", 0))
        open("/tmp/diag.json", "w").write(self.rfile.read(n).decode())
        self.send_response(200)
        self.send_header("Access-Control-Allow-Origin", "*")
        self.end_headers()

Significance

These techniques demonstrate AI agents' ability to combine existing tools in unprecedented ways, creating automation solutions that work outside traditional frameworks. This represents a new category of emergent agent capabilities with both powerful problem-solving potential and significant security implications.

See also