# CoffeeShot SDK Shared photographic tools for browser and Expo: optional vision guidance, natural local corrections and original preservation. No generative image edits. ## Browser ```js import { createPhotoSession } from '@agentcore/coffeeshot'; const session = createPhotoSession({ video: document.querySelector('video'), guidanceUrl: '/api/photo/guidance', onGuidance: ({ message }) => { hint.textContent = message; }, onError: error => { status.textContent = error.message; }, }); // Invoke each operation from the corresponding explicit UI action. await session.start(); session.guide(true); const { original, corrected } = await session.capture(); session.destroy(); ``` The host provides a same-origin, cookie-authenticated gateway to the existing CoffeeFrame API. A small JPEG preview goes to its vision model, one request at a time, with a three-second wait after each response. Errors pause guidance; capture, hidden pages and disposal cancel it. Actual latency depends on the model. Never describe these previews as continuous live video or frame-by-frame analysis. `correctPhotoBlob` analyzes pixels and applies bounded exposure, white balance, contrast, saturation and sharpening to a <=1600px copy. The original Blob stays untouched. No object additions, removals, face/body edits or geometric changes. ## Expo ```ts import { correctPhoto, createGuidanceLoop } from '@agentcore/coffeeshot/native'; ``` The native entry contains no DOM code. Hosts adapt official Expo Camera, ImageManipulator and FileSystem APIs; JPEG codecs provide RGBA pixels to `correctPhoto`. `createGuidanceLoop` shares cancellation and scheduling rules. The CoffeeFrame app is a source-only integration; no native build is implied. ## Distribution and validation Public contract: https://coffeeshot-sdk.pages.dev/SDK_CONTRACT.md. Browser ESM: https://coffeeshot-sdk.pages.dev/coffeeshot-sdk.mjs. Immutable runtime package: https://coffeeshot-sdk.pages.dev/agentcore-coffeeshot-0.2.1.tgz. Runtime package includes declarations and excludes development lifecycle scripts. Publish canonical main with `github-publish-main "message [cloudflare:full]"`. Cloudflare Pages owns builds and tests; no local build/test. Full checks TypeScript, contracts, correction invariants and cancelled/stale guidance responses. Consumers: CoffeeFrame website `/photo/`, CoffeeFrame Expo `/photo`, and the owner-only https://coffeeshot-test-website.pages.dev camera lab. Authentication, model access and secrets stay with the product Workers. No SDK-owned Worker. The older `createClient` API remains for compatibility. Its omitted-apiUrl analysis is explicitly a mock; new photo integrations use the APIs above.