{"id":51339675,"url":"https://github.com/semcod/nlp2uri","last_synced_at":"2026-07-02T06:04:49.638Z","repository":{"id":362960999,"uuid":"1261426557","full_name":"semcod/nlp2uri","owner":"semcod","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-06T18:57:41.000Z","size":3262,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-06T19:19:37.373Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/semcod.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-06T17:06:42.000Z","updated_at":"2026-06-06T18:57:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/semcod/nlp2uri","commit_stats":null,"previous_names":["semcod/nlp2uri"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/semcod/nlp2uri","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semcod%2Fnlp2uri","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semcod%2Fnlp2uri/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semcod%2Fnlp2uri/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semcod%2Fnlp2uri/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/semcod","download_url":"https://codeload.github.com/semcod/nlp2uri/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semcod%2Fnlp2uri/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35035008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-02T02:00:06.368Z","response_time":173,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-07-02T06:04:48.658Z","updated_at":"2026-07-02T06:04:49.625Z","avatar_url":"https://github.com/semcod.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nlp2uri\n\n\n## AI Cost Tracking\n\n![AI Cost](https://img.shields.io/badge/AI%20Cost-$3.75-green) ![AI Model](https://img.shields.io/badge/AI%20Model-openrouter%2Fqwen%2Fqwen3-coder-next-lightgrey)\n\nThis project uses AI-generated code. Total cost: **$3.7500** with **25** AI commits.\n\nGenerated on 2026-06-29 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/models/openrouter/qwen/qwen3-coder-next)\n\n---\n\nPython library and CLI — **kompilator NL → URI → akcje OS** dla operacji desktopowych.\n\nWejście (naturalny język):\n\n- „otwórz VS Code w folderze ~/projekty/nlp2uri”\n- „zrób screenshot aktywnego okna przeglądarki”\n- „otwórz plik invoice-2025.pdf”\n\nWyjście:\n\n1. **Abstrakcyjny URI** (RFC 3986, niezależny od OS)\n2. **Plan akcji** `OSAction[]` — konkretne komendy per platforma\n3. (Opcjonalnie) wykonanie lub payload MCP (`text/uri-list`)\n\n## Architektura\n\n```mermaid\nflowchart LR\n    NL[Natural language] --\u003e PARSE[parse_nl]\n    PARSE --\u003e INTENT[UriIntent + slots]\n    INTENT --\u003e BUILD[schemes/build]\n    BUILD --\u003e SPEC[UriSpec abstract URI]\n    SPEC --\u003e COMPILE[compile_uri_to_actions]\n    COMPILE --\u003e ACTIONS[OSAction plan]\n    ACTIONS --\u003e EXEC[execute_uri / MCP]\n```\n\n### Warstwy\n\n| Warstwa | Moduł | Opis |\n|---------|-------|------|\n| NLP → intencja | `parse_nl` | Heurystyki EN + PL → `UriIntent` |\n| Intencja → URI | `schemes/*` | Abstrakcyjne schemy OS-neutral |\n| URI → OS | `compile` | `compile_uri_to_actions()` |\n| Wykonanie | `runtime` | `subprocess` / dry-run |\n| MCP | `mcp` | `text/uri-list`, tool payloads |\n\n## Abstrakcyjne schemy URI\n\n| Scheme | Przykład | Znaczenie |\n|--------|----------|-----------|\n| `app://` | `app://vscode/open?path=/home/tom/...` | Otwórz aplikację / IDE |\n| `app://file/open` | `app://file/open?path=/tmp/x.pdf` | Otwórz plik |\n| `desktop-screenshot://` | `desktop-screenshot://window?title=Chrome\u0026mode=active` | Screenshot okna/ekranu |\n| `desktop-window://` | `desktop-window://focus?name=slack` | Fokus okna |\n| natywne | `vscode://`, `cursor://`, `file://`, `ms-settings:` | Passthrough do handlera OS |\n\nMetadata `native_uri` zawiera deep-link IDE (`vscode://file/...`) gdy istnieje.\n\n## Konfiguracja (`nlp2uri.yaml`)\n\nDomyślne ustawienia w pliku `nlp2uri.yaml` (auto-tworzony przy pierwszym uruchomieniu):\n\n```yaml\nplatform: auto          # auto | linux | darwin | windows\nhost_platform: linux  # ostatnio wykryty host (informacyjnie)\nlocale: null\ndry_run: false\ncapture_dir: /tmp/nlp2uri-captures\n```\n\nKolejność wyboru platformy: `--platform` → `NLP2URI_PLATFORM` → `nlp2uri.yaml` → auto-detect OS.\n\n```bash\nnlp2uri config show --json    # efektywna konfiguracja\nnlp2uri config init           # zapisz domyślny nlp2uri.yaml\n```\n\nŚcieżki szukania configu: `NLP2URI_CONFIG` → `./nlp2uri.yaml` → `~/.config/nlp2uri/nlp2uri.yaml`.\n\n## Quick start\n\n```bash\npip install -e \".[dev]\"\n\n# Platforma wykrywana automatycznie (bez --platform)\nnlp2uri plan \"otwórz vscode w folderze ~/github/semcod/nlp2uri\" --json\nnlp2uri resolve \"zrób screenshot aktywnego okna przeglądarki\" --json\nnlp2uri execute \"open firefox\" --dry-run\n```\n\n## Sterowanie IDE (Koru / koruide)\n\nWarstwa planowania `koru.control.v1` — NL → URI → drive przez socket koruide (nie wykonuje samodzielnie klawiatury; wymaga działającego daemona Koru + pluginu VSIX w IDE).\n\n```bash\nexport KORU_AUTOPILOT_INSTANCE=cursor-main   # socket instancji Cursor\n\n# Plan (NL → control plan + URI)\nnlp2uri control plan \"wyślij probe do cursor\" --text \"treść wiadomości\" --json\n\n# Wykonanie (plan + drive); workspace z live status gdy daemon działa\nnlp2uri control execute \"probe test\" --text \"hello\" --json\n\n# Tylko wklejenie (submit=false — stabilniejsze na Cursor Glass UI)\nnlp2uri control execute \"...\" --text \"...\" --no-submit --json\n\n# Indeks URI z autopilot status\nnlp2uri control list-uris --json\n```\n\nOdpowiedniki w Koru: `koru ide control plan|execute|list-uris` oraz narzędzia MCP `koru_ide_*` (wymagają `koru mcp-serve`, nie są komendami shell).\n\n| Flaga | Znaczenie |\n|-------|-----------|\n| `--text` / `--text-file` | Treść wiadomości (osobno od promptu NL) |\n| `--ide` / `--instance` | Lane IDE (`cursor-main` → `cursor`) |\n| `--project` | Katalog do dopasowania `workspace` z plugin status |\n| `--no-submit` | Paste bez Enter / submit |\n| `--dry-run` | Tylko plan, bez drive |\n\nDla `cursor` + `submit=true` plan domyślnie ustawia `strategy_hint=submit_alt_glass_first` (kolejność submit w probe ladder).\n\n## Python API (service facade)\n\n```python\nfrom nlp2uri import NLP2URIService\nfrom nlp2uri.models import HostPlatform\n\nsvc = NLP2URIService.default()  # ładuje nlp2uri.yaml + auto-detect\n\nplan = svc.from_prompt(\"otwórz vscode w folderze /tmp/foo\")\nprint(plan.uri)                    # app://vscode/open?path=/tmp/foo\nprint(plan.actions[0].argv())      # ['xdg-open', 'vscode://file/tmp/foo']\n\npayload = svc.handle_prompt(\"open firefox\", dry_run=True)  # prompt → URI → run\n```\n\n## Adaptery i integratory (reużywalne powierzchnie)\n\n| Warstwa | Użycie | Moduł |\n|---------|--------|-------|\n| **Service** | `NLP2URIService.from_prompt()` / `handle_uri()` | `nlp2uri.service` |\n| **CLI** | `nlp2uri plan\\|resolve\\|compile\\|execute` | `nlp2uri.adapters.cli` |\n| **Shell** | `eval \"$(nlp2uri shell export '…')\"` | `nlp2uri.adapters.shell` |\n| **REST** | `nlp2uri-serve --port 8766` | `nlp2uri.integrators.rest_server` |\n| **MCP** | `nlp2uri-mcp` (stdio JSON-RPC) | `nlp2uri.integrators.mcp_server` |\n\n### REST (`POST /v1/plan`)\n\n```bash\ncurl -s -X POST http://127.0.0.1:8766/v1/plan \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"prompt\":\"open firefox\"}'\n```\n\n### MCP (Cursor / Windsurf)\n\n```json\n{ \"mcpServers\": { \"nlp2uri\": { \"command\": \"nlp2uri-mcp\" } } }\n```\n\nTools: `nlp2uri_plan`, `nlp2uri_resolve`, `nlp2uri_compile`, `nlp2uri_execute`, `nlp2uri_handle`.\n\n### Shell\n\n```bash\neval \"$(nlp2uri shell export 'open firefox')\"\necho \"$NLP2URI_URI\"    # app://firefox/open\n$nlp2uri-run           # alias do skompilowanej komendy\n```\n\n### Własny adapter\n\n```python\nfrom nlp2uri.adapters.base import AdapterRequest\nfrom nlp2uri.adapters.rest import RestAdapter\n\nresponse = RestAdapter().dispatch(\"plan\", {\"prompt\": \"capture screen\", \"platform\": \"linux\"})\nprint(response.data[\"uri\"])\n```\n\n## Standardy\n\n| Standard | Rola |\n|----------|------|\n| [RFC 3986](https://www.rfc-editor.org/rfc/rfc3986) | Składnia URI (`scheme`, `path`, `query`) |\n| [RFC 8089](https://www.rfc-editor.org/rfc/rfc8089) | `file://` |\n| [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110) | `http(s)://` |\n| [Freedesktop Desktop Entry](https://specifications.freedesktop.org/desktop-entry-spec/latest/) | `.desktop`, `x-scheme-handler/\u003cscheme\u003e` |\n| [XDG Desktop Portal](https://flatpak.github.io/xdg-desktop-portal/) | Screenshot Wayland |\n| Windows URI activation | `ms-settings:`, rejestracja schemów |\n| macOS URL Schemes | `CFBundleURLSchemes` w `Info.plist` |\n| MCP `text/uri-list` | Lista URI dla hosta / MCP Apps |\n\n## Przydatne biblioteki\n\n| Biblioteka | Kiedy |\n|------------|-------|\n| `urllib.parse`, `webbrowser`, `subprocess` | Już używane (stdlib) |\n| `psutil` | PID → okno |\n| `pyxdg` | Parsowanie `.desktop` |\n| `dbus-python` + PyGObject | XDG Portal screenshot |\n| `pywin32` | Win32 `SetForegroundWindow` |\n| `pyobjc` / Quartz | macOS window ID |\n| `spaCy` / `transformers` | Zamiast heurystyk regex |\n| `nlp2dsl` / `nlp2cmd-intent` | IntentIR z LLM (jak `nlpshim`) |\n\n## Testy i Docker\n\n```bash\npython -m pytest\ndocker compose build \u0026\u0026 docker compose run --rm nlp2uri-test\n./examples/run-e2e.sh\n```\n\nPrzykłady per kategoria: [examples/README.md](examples/README.md).\n\nW Dockerze:\n\n- unit: NLP → URI → `OSAction`\n- integracja: rejestracja `testapp://` przez `.desktop` + `xdg-open` (`NLP2URI_INTEGRATION=1`)\n\n## CQRS + ES + Protobuf (generowanie driverów i API)\n\nKażdy typ URI ma własne drzewo **commands / events / queries / driver / api**:\n\n```bash\ncd schemas \u0026\u0026 make all          # scaffold + MCP schemas + driver stubs\ncd schemas \u0026\u0026 make proto        # buf → Python gRPC + OpenAPI (wymaga buf CLI)\n```\n\n→ [schemas/README.md](schemas/README.md) · [schemas/uri_cqrs_es.v1.md](schemas/uri_cqrs_es.v1.md)\n\n## Orchestracja ekosystemu (MCP, usługi, artefakty, getv)\n\nPełny przewodnik z przykładami uruchomienia i kontroli wielu backendów:\n\n- **[docs/orchestration.md](docs/orchestration.md)** — URI + MCP + todomat + koru + scenariusze E2E\n- [docs/system_map_uri.v1.md](docs/system_map_uri.v1.md) — `command://`, `artifact://`, `service://`, …\n- [docs/getv_uri.v1.md](docs/getv_uri.v1.md) — `getv://` zmienne środowiskowe\n- [docs/mcp-tools.md](docs/mcp-tools.md) — lista narzędzi `nlp2uri-mcp`\n\n```bash\npip install -e \".[envmap]\"    # getv + env2llm\nnlp2uri list-getv --json\nnlp2uri resolve-getv \"GROQ_API_KEY\" --json\nnlp2uri list-system-uris --example-dir ~/github/wronai/nlp2dsl/examples/01-invoice --json\n```\n\n## Plan rozwoju\n\n[docs/roadmap.md](docs/roadmap.md) · [docs/mcp-tools.md](docs/mcp-tools.md) · CI: `.github/workflows/ci.yml`\n\n## Relacja z ekosystemem Semcod\n\n- **`nlpshim`** — NLP → DSL / workflow\n- **`nlp2uri`** — NLP → URI → akcje (desktop, getv, SystemMap, MCP)\n- **`todomat`** — orchestrator MCP/HTTP (curllm, nlp2dsl, iterun, nlp2uri)\n- **`koru`** — bridge MCP `koru_desktop_uri_*` + planfile tickets\n- **`getv`** — zmienne env → `getv://` URI\n\n## License\n\nLicensed under Apache-2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemcod%2Fnlp2uri","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsemcod%2Fnlp2uri","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemcod%2Fnlp2uri/lists"}