VQL - Visual Query Language
before
uri2vql pipeline-analyze --image /tmp/screen.png --out app.vql.json --llm
after
uri2vql vql-to-image --program app.vql.json --out app.render.png
VQL objects app.vql.json
{
"version": "1.0",
"render_target": "svg",
"scene": {
"width": 2560.0,
"height": 1600.0,
"background": "#FFFFFF",
"url": "file:///tmp/screen.png",
"app": "desktop",
"layers": [
{
"id": "screen_regions",
"objects": [
{
"id": "region_000",
"primitives": [
{
"shape_type": "rectangle",
"params": {
"width": 213.0,
"height": 133.0
}
}
],
"style": {
"color": "#2F342E",
"fill": true,
"stroke_width": 0.0,
AI Cost Tracking
- 🤖 LLM usage: $11.5573 (8 commits)
- 👤 Human dev: ~$659 (6.6h @ $100/h, 30min dedup)
Generated on 2026-06-24 using openrouter/qwen/qwen3-coder-next
VQL (Visual Query Language) — język wektorowego opisu fotografii, rysunków i zrzutów ekranu.
Samodzielna paczka Python z IR (VQLProgram), kompilatorem NL→VQL, walidacją i rendererami SVG/PNG. Sterowana przez DSL i bus CQRS/ES w paczkach *2vql.
Ekosystem: SUMD (opis) → DOQL (deklaracja) → Makefile/taskfile (automation) → testql (weryfikacja)
Dokumentacja: docs/README.md · Przykłady: examples/README.md · SUMD: SUMD.md
Instalacja
pip install vql # core
pip install vql[png] # eksport PNG (cairosvg)
pip install vql[desktop] # zrzut ekranu (pillow, mss)
bash install-dev.sh # pełny stack dev
Szybki start — rysowanie
from vql import nl_to_program, render_to_svg
program = nl_to_program("narysuj czerwone koło", width=400, height=400)
svg = render_to_svg(program)
dsl2vql -c 'COMPILE "narysuj niebieski kwadrat"'
rest2vql serve --port 8216
Szybki start — zrzut ekranu → VQL
# Automatyzacja LLM: vdisplay → imgl (bez dialogu GNOME, gdy mirror działa)
imgl capture -o /tmp/screen.png --verify --analyze --lang eng+pol
# Alternatywa: portal GNOME (docs/desktop-capture.md)
uri2vql capture-screen --interactive --out /tmp/screen.png
# All-in-one
uri2vql capture-and-analyze --out app.vql.json --diagnose
# Lub krok po kroku
uri2vql analyze-window --image /tmp/screen.png --out app.vql.json --grid 12
uri2vql adopt-ui --image /tmp/screen.png --out ui.vql.json --locale pl
uri2img2svg query "img2svg://svg?path=/tmp/screen.png&out=/tmp/screen.svg"
uri2vql query "vql://window/summary?file=app.vql.json&live=1&image=/tmp/screen.png"
Pełny skrypt: bash examples/full-pipeline.sh
Fotografia ↔ VQL (roundtrip)
Opis z obrazu i odtworzenie z metadanych — zależnie od typu obrazu:
# Test roundtrip (próbki + raport fidelity)
python examples/photo-roundtrip-test.py
make test-roundtrip
# Opis mozaiką kolorów
img2svg vql photo.png --out photo.vql.json --grid 20
# Wektoryzacja kolorowa (lepsza dla płaskich kształtów)
pip install 'img2svg[vtracer]'
img2svg vql photo.png --out photo.vql.json --method vtracer
# Odtworzenie
python -c "
from vql import VQLProgram, render_to_png
import json
p = VQLProgram.from_dict(json.load(open('photo.vql.json')))
render_to_png(p, 'reconstructed.png')
"
Macierz jakości i biblioteki: docs/photo-roundtrip.md
Interfejsy
| Warstwa | Window / screenshot | SVG |
|---|---|---|
| CLI | uri2vql, img2vql |
img2svg, uri2img2svg, dsl2img2svg |
| URI | vql://window/* |
img2svg://vectorize|svg|vql |
| REST | POST /v1/window/* :8216 |
planowane |
| MCP | vql_detect_ui, vql_diagnose_window, … |
— |
REST: docs/rest-window-api.md · URI: docs/window-uri.md · SVG: docs/img2svg-uri.md
Desktop adopt + img2nl
| Etap | Narzędzie | Co robi |
|---|---|---|
| Capture | imgl capture (vdisplay) / uri2vql capture-screen |
PNG + provenance / portal |
| Grid adopt | analyze-window |
scalone regiony + fingerprint |
| UI detect | img2vql / adopt-ui |
okna, przyciski, bbox, relations |
| Wektoryzacja | img2svg / uri2img2svg |
PNG → SVG / VQL |
| Diagnose | diagnose-window |
routing LLM + auto-OCR |
| Compare | compare-window |
phash — zmiana ekranu? |
| OCR semantyczny | adopt-imgl / imgl |
tekst + role + interakcja |
Pipeline: docs/window-pipeline.md · LLM capture: docs/vdisplay-imgl-automation.md · Portal: docs/desktop-capture.md
Przykłady
bash examples/live-capture-test.sh
bash examples/full-pipeline.sh
bash examples/img2nl-vql-flow.sh /tmp/screen.png
VQL_TEST_IMAGE=/tmp/screen.png bash examples/full-pipeline.sh
Development
make install-dev # pełny stack *2vql
make test # pytest core + dsl2vql
make test-all # wszystkie pakiety
make serve # rest2vql :8216
make goal # test + commit + publish (goal.yaml)
bash project.sh # SUMD + DOQL + testql + analiza
Zmienne LLM: skopiuj .env.example → .env (OPENROUTER_API_KEY, LLM_MODEL).
Struktura monorepo
src/vql/ — domena (schema, compiler, renderers, adopt/window)
packages/
dsl2vql/ uri2vql/ nlp2vql/ cli2vql/ rest2vql/ mcp2vql/
img2vql/ — detekcja UI + img2nl diagnose (v0.2)
img2svg/ — obraz → SVG / VQL (v0.1)
uri2img2svg/ — img2svg:// URI (v0.1)
dsl2img2svg/ — VECTORIZE / TO_VQL DSL (v0.1)
docs/ — dokumentacja
examples/ — skrypty demo (README w examples/)
testql-scenarios/ — kontrakty testql (CLI, pytest)
Skala (SUMD): 151 modułów · 278 funkcji · ~12.5k LOC · CC̄=4.2
Szczegóły: packages/README.md · docs/packages.md
Status
- TODO.md — checklist + analiza
- CHANGELOG.md — historia zmian
- SUMD.md — auto-opis projektu (DOQL, testql, call graph)
License
Licensed under Apache-2.0.
Metadata
Release files for vql 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vql-0.1.7.tar.gz | 3.3 MB | Without provenance | Details for vql-0.1.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vql-0.1.7-py3-none-any.whl | Python 3 | none | any | Details for vql-0.1.7-py3-none-any.whl |
Total release size: 3.3 MB
Release files / vql-0.1.7.tar.gz
| Download URL | vql-0.1.7.tar.gz |
|---|---|
| Size | 3.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
772391182dd40c5750c319475a9b540da8dcd488ad14c95c99b6a9fa0df06ec2
|
|
BLAKE2b-256 checksum How to use checksums |
e80a35098663aea00e1aabfda8507cf60fce530d226fddc5b80f1268e5c7f8ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / vql-0.1.7-py3-none-any.whl
| Download URL | vql-0.1.7-py3-none-any.whl |
|---|---|
| Size | 81.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
43b268548ce0c1a764da6f7f7dc5e951ea343a3b3ae3243af3301d5b5bc900ce
|
|
BLAKE2b-256 checksum How to use checksums |
9a7b6e89afc8e1c25c6592cf0d32ee255497cdda78150c8370bc18aa3d9b4125
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for vql 0.1.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.