Skip to content

docs: connector authoring guidelines for desktop/mobile portability - #16

Open
volod-vana wants to merge 1 commit into
PDP-Connect:mainfrom
volod-vana:volod/connector-authoring-guidelines
Open

docs: connector authoring guidelines for desktop/mobile portability#16
volod-vana wants to merge 1 commit into
PDP-Connect:mainfrom
volod-vana:volod/connector-authoring-guidelines

Conversation

@volod-vana

Copy link
Copy Markdown
Contributor

Connectors are written against the page API, not against a browser. Desktop implements it with Playwright + Chromium; mobile implements it with a native WebView shim. A connector that only assumes the page contract runs on both - one that assumes Chromium on a laptop does not.

This adds CONNECTOR-GUIDELINES.md documenting the rules that keep that true, plus a link from the "Building a new connector" section.

Every rule is a failure actually hit while running real connectors on both runtimes, not a hypothetical:

  1. Detect state from APIs, not page chrome. The most common break. A login check keyed on nav[aria-label="Chat history"] / [data-testid="profile-button"] never fires on a phone viewport, so the connector waits forever for a login that already happened. A session-endpoint check is layout independent - and more robust on desktop too.
  2. Make the run resumable. Mobile can lose the runtime mid-run (OS kills the WebView, user backgrounds the app). There is no pause-and-continue; only what you checkpointed survives.
  3. Fetch from inside the page, do not intercept the network. Reading response bodies off the app's own traffic is desktop-only in practice - iOS has no API for it, Android only partial. Fine as a fallback, not as the primary data path.
  4. Keep page.evaluate payloads self-contained. No in-page eval/new Function: strict CSP rejects them, and mobile has no debugger-protocol escape hatch the way desktop does.
  5. Never require credentials from the driver. requestInput is optional and absent on mobile by design - we do not want the app handling a user's third-party password. Always keep the showBrowser + promptUser fallback, and treat the showBrowser URL as a hint.
  6. Declare desktop-only capabilities and fail cleanly. Binary download + unzip, cross-origin iframes, network response bodies. A clean failure routes to desktop handoff; a silent one looks like a broken app.
  7. Report progress and bound the work. Runtime scales with the user's data - a small account finishes in under a minute, a large one can run far longer. The UI can only be honest about that if the connector emits counts.
  8. Do not assume desktop layout or viewport.

Also includes a capability matrix (desktop vs iOS vs Android) and a pre-PR checklist.

Context: written after running unmodified connectors from this repo on a phone through a page-API shim. Most of the corpus ports as-is; the exceptions are exactly the capabilities in rule 6.

@volod-vana
volod-vana force-pushed the volod/connector-authoring-guidelines branch from 1fbc5e3 to 5eafcd8 Compare July 29, 2026 15:21
Connectors are written against the page API, not against a browser. Desktop
implements it with Playwright + Chromium, mobile with a native WebView shim, so a
connector that only assumes the page contract runs on both.

Documents the eight rules that keep that true, each one a failure hit while running
real connectors on both runtimes:

- detect state from APIs, not page chrome (the desktop-layout login check is the
  most common break)
- make runs resumable, because mobile can lose the runtime mid-run
- fetch from inside the page instead of intercepting the network (iOS has no
  response-body interception)
- keep evaluate payloads self-contained, no in-page eval (strict CSP rejects it and
  mobile has no debugger-protocol escape hatch)
- never require credentials from the driver; requestInput is optional by design
- declare desktop-only capabilities and fail cleanly to desktop handoff
- report progress with counts; runtime scales with the user's data
- do not assume desktop layout or viewport

Includes a capability matrix (desktop vs iOS vs Android) and a pre-PR checklist.

Signed-off-by: Volod <volod@vana.com>
@volod-vana
volod-vana force-pushed the volod/connector-authoring-guidelines branch from 5eafcd8 to 152ca31 Compare July 29, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant