Skip to content

feat(import): opt-in cloud vision screenshot import (BYO OpenRouter key) - #45

Merged
benasbarciauskas merged 4 commits into
mainfrom
feat/cloud-vision
Jun 23, 2026
Merged

feat(import): opt-in cloud vision screenshot import (BYO OpenRouter key)#45
benasbarciauskas merged 4 commits into
mainfrom
feat/cloud-vision

Conversation

@benasbarciauskas

Copy link
Copy Markdown
Owner

Adds an opt-in "Read with AI" path: an imported workout screenshot is sent to a vision LLM via the user's own OpenRouter key, returning a structured workout (image→structured) — for messy/handwritten screenshots the on-device path can't crack. Tesseract stays the free, on-device default. Web-only.

How

  • aiParseWorkoutsFromImages() reuses the existing aiParseWorkouts prompt + catalog mapping via a shared helper (text path byte-identical). Multimodal image_url content, temp 0, json_object, ≥1 image required, cap 8 (surfaced via toast).
  • New aiVisionModel setting (default meta-llama/llama-3.2-11b-vision-instruct:free — text default isn't vision-capable), wired through persistence like aiModel.
  • ImportPage "Read with AI" button shows only when a key is set; one-line notice "Sends the image to OpenRouter with your key." Routes into the same Review flow.

Privacy/security

Strictly opt-in; HTTPS + Bearer key; no key/image logged or persisted; nothing leaves the device unless the user clicks.

Verification

356 tests (mocked fetch/FileReader, no network): request shape, mapping, every error branch, image-count guard + cap, button gating. Code review: "Ready to merge: Yes."

Spec: docs/superpowers/specs/2026-06-23-cloud-vision-import-design.md

benasbarciauskas and others added 4 commits June 23, 2026 19:17
Add aiParseWorkoutsFromImages to openrouter.ts — builds a multimodal user
message (text + image_url parts) and reuses the shared fetch/parse pipeline.

Default vision model: meta-llama/llama-3.2-11b-vision-instruct:free (free,
vision-capable on OpenRouter). aiVisionModel added to AppSettings, DEFAULT_SETTINGS,
and Settings UI. ImportPage shows opt-in 'Read with AI' button when images are
staged and an API key is configured; Tesseract remains the default.
@benasbarciauskas
benasbarciauskas merged commit 5d67643 into main Jun 23, 2026
1 check passed
@benasbarciauskas
benasbarciauskas deleted the feat/cloud-vision branch June 23, 2026 18:54
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