ifURI examples
← all examples

46 — connect anything through URI adoption

This example shows the intended first step for reusing an existing application, library, service, Docker project, desktop app, mobile app or URI capability pack through urirun.

The connector is:

urirun-connector-adopt

It exposes:

adopt://host/project/query/inspect
adopt://host/project/query/plan
adopt://host/projects/query/scan

Why this exists

The goal is not to hardcode every integration into urirun. The goal is to make a local project describe itself enough that urirun can choose the smallest wrapper:

project metadata -> adopt:// plan -> connector/service/widget/artifact flow -> contract check

Try real local projects

cd /home/tom/github/if-uri/urirun-connector-adopt
PYTHONPATH=. /home/tom/github/if-uri/urirun/venv/bin/python -c \
  'from urirun_connector_adopt.core import main; raise SystemExit(main(["inspect","--path","/home/tom/github/tellmesh/uriimg2nl"]))'

PYTHONPATH=. /home/tom/github/if-uri/urirun/venv/bin/python -c \
  'from urirun_connector_adopt.core import main; raise SystemExit(main(["plan","--path","/home/tom/github/wronai/ocr"]))'

Expected groups:

Run all examples

bash /home/tom/github/if-uri/examples/46-connect-anything/run_examples.sh

The script demonstrates:

Direct Commands

Inspect an existing URI pack:

/home/tom/github/if-uri/urirun/venv/bin/urirun-adopt inspect \
  --path /home/tom/github/tellmesh/uriimg2nl

Plan OCR reuse:

/home/tom/github/if-uri/urirun/venv/bin/urirun-adopt plan \
  --path /home/tom/github/wronai/ocr

Inspect a desktop screenshot/OCR library:

/home/tom/github/if-uri/urirun/venv/bin/urirun-adopt inspect \
  --path /home/tom/github/semcod/imgl

Use a generated bindings file:

/home/tom/github/if-uri/urirun/venv/bin/urirun-adopt bindings > /tmp/adopt.bindings.json
/home/tom/github/if-uri/urirun/venv/bin/urirun run \
  adopt://host/project/query/inspect \
  /tmp/adopt.bindings.json \
  --execute \
  --payload '{"path":"/home/tom/github/tellmesh/uriimg2nl"}'

Use installed connector entry points:

/home/tom/github/if-uri/urirun/venv/bin/urirun run \
  adopt://host/project/query/plan \
  --entry-points \
  --execute \
  --payload '{"path":"/home/tom/github/wronai/ocr"}'

Example NL Intents

These are the user-facing prompts the chat layer can turn into adopt:// flows:

Podlacz lokalny projekt ~/github/wronai/ocr jako usluge OCR przez URI.
Sprawdz, czy ~/github/tellmesh/uriimg2nl ma gotowe trasy URI i pokaz je.
Znajdz w ~/github/semcod projekty, ktore da sie uruchamiac jako CLI connector.
Przygotuj plan podlaczenia aplikacji desktopowej z OCR i screenshotami.
Wygeneruj kontrakty dla projektu Docker, zanim zostanie uruchomiony.

The intended flow is:

task:
  id: connect-local-project
steps:
  - id: inspect
    uri: adopt://host/project/query/inspect
    payload:
      path: /home/tom/github/wronai/ocr
  - id: plan
    uri: adopt://host/project/query/plan
    payload:
      path: /home/tom/github/wronai/ocr
  - id: choose-runtime
    decision:
      from: "${steps.plan.project.groups}"
      prefer:
        - uri-pack
        - connector
        - service
        - docker
        - cli
  - id: generate-or-select-connector
    uri: connector://host/generated/command/create
    payload:
      plan: "${steps.plan.plan}"
  - id: verify-contract
    uri: connector://host/generated/command/verify
    payload:
      contract: "${steps.plan.plan.contracts}"

Group Meaning

Rule

adopt:// discovers and plans. It should not run unknown software. After inspection, generate or select a concrete connector/service, attach a realization contract, then execute through a domain URI route.

Verify

# live demo against real local repos (tellmesh / wronai / semcod):
bash run_examples.sh

# self-contained, no external checkouts (CI-safe) — inspect + plan + scan on tmp fixtures:
python -m pytest examples/46-connect-anything/test_connect_anything.py -q

Files

README.mdrun_examples.shtest_connect_anything.py.urirun/

View on GitHub →