Location Scout Buyer
Lovable AI runs the agent that secures private property access via UCP Checkout so shooters get guaranteed, signed location permits.
UCP Checkout· deterministic commerce
Section · Agentic
full primer →The kernel.
Photographers delegate location scouting to an agent that shops a UCP merchant on their behalf — the response is a signed order envelope, deterministic and auditable, with the agent's reasoning attached.
Why this primitiveThe signed checkout envelope proves to location owners and insurance auditors that the site fee was paid and accepted.
Kernel
a Zod-validated UCP merchant — `discovery` → `createCheckout` → `recordCheckoutPayment` — with RFC 9421 HTTP Message Signatures so any downstream agent or auditor can verify the order envelope without trusting the merchant
Drives the UI as
a one-tap checkout surface that lets an agent shop a fixed catalog and return a verifiable order JSON the user can copy or settle
Required key.
LOVABLE_API_KEY
Auto-provisioned by Lovable when you enable the Lovable AI add-on. Powers the buyer, seller and merchant agents through an OpenAI-compatible gateway in front of every frontier LLM. Zero copy-paste.
open ↗Add this in your Lovable project under Settings → Secrets before pasting the prompt below.
Appendix · Mega-prompt
The build prompt.
budget · 1 message
Paste into a fresh Lovable project. Make sure the key above is set first. read the build strategy →
Build "Location Scout Buyer" as a ONE-SHOT Lovable build. The participant has only
5 credits — this single message must produce a working demo with no follow-ups.
Single-page TanStack Start app. Cut scope ruthlessly.
CONCEPT
Lovable AI runs the agent that secures private property access via UCP Checkout so shooters get guaranteed, signed location permits.
Discipline: Photography (location scouting).
Recipe: UCP Checkout (deterministic commerce) as the single agentic surface.
Why this kernel: The signed checkout envelope proves to location owners and insurance auditors that the site fee was paid and accepted.
LOVABLE BUDGET (HARD CAP: ONE-SHOT, ~5 CREDITS TOTAL):
The participant has FIVE Lovable credits for the whole build. This prompt MUST
ship a working demo on the FIRST message with zero follow-ups. Engineer for that.
- ONE TanStack Start app, ONE route (`src/routes/index.tsx`). No extra pages, no auth, no nav.
- ONE TanStack server function in `src/lib/agent.functions.ts` that runs the protocol.
- ONE client surface (a textarea + button) that triggers the server fn and renders the result.
- NO database, NO Lovable Cloud, NO auth, NO file uploads, NO extra integrations.
- NO tests, NO docs pages, NO settings screens, NO theming toggles.
- Libraries: template defaults + `zod` + `ai` + `@ai-sdk/openai-compatible`. Nothing else.
- Demo-fallback contract: every code path must boot with NO secrets and return
realistic JSON flagged `simulated: true`. Real LLM calls activate only when
`LOVABLE_API_KEY` is present (auto in Lovable).
STACK
- TanStack Start app, the index route only.
- Agent brain: Lovable AI Gateway via the AI SDK, called from a `createServerFn` handler so the key stays server-side.
- Protocol surface: UCP Checkout as defined below.
- Client surface fits the kernel: a prompt box (and any minimal extra inputs) that returns the agent's output.
- Tailwind + shadcn. Editorial look: gold accent on a dark or warm-cream background,
generous type, one strong headline, one primary action.
- Footer renders: "Built during the Creative AI & Quantum Hackathon organised by StreetKode Fam during Indian Krump Festival 14".
GATEWAY HELPER (src/lib/ai-gateway.server.ts) — Lovable AI Gateway provider:
```ts
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
/** Built during the Creative AI & Quantum Hackathon organised by StreetKode Fam during Indian Krump Festival 14 */
export function lovableGateway(apiKey: string) {
return createOpenAICompatible({
name: "lovable",
baseURL: "https://ai.gateway.lovable.dev/v1",
headers: { "Lovable-API-Key": apiKey, "X-Lovable-AIG-SDK": "vercel-ai-sdk" },
});
}
```
Install once: `bun add ai @ai-sdk/openai-compatible zod`.
SERVER FUNCTION (src/lib/agent.functions.ts) — UCP Checkout agent:
```ts
import { createServerFn } from "@tanstack/react-start";
import { generateObject } from "ai";
import { z } from "zod";
import { lovableGateway } from "@/lib/ai-gateway.server";
const CATALOG = [
{ sku: "location scouting-basic", name: "location scouting — basic", price_minor: 1900, currency: "USD" },
{ sku: "location scouting-pro", name: "location scouting — pro", price_minor: 4900, currency: "USD" },
{ sku: "location scouting-studio", name: "location scouting — studio", price_minor: 12900, currency: "USD" },
];
/** Built during the Creative AI & Quantum Hackathon organised by StreetKode Fam during Indian Krump Festival 14 */
export const buy = createServerFn({ method: "POST" })
.inputValidator((d) => z.object({ goal: z.string().min(1).max(800) }).parse(d))
.handler(async ({ data }) => {
const key = process.env.LOVABLE_API_KEY;
// Demo-fallback contract: boot with NO secrets, return realistic envelope.
if (!key) {
return ucpEnvelope([CATALOG[0]], data.goal, { simulated: true, reason: "no LOVABLE_API_KEY" });
}
const gw = lovableGateway(key);
const { object } = await generateObject({
model: gw("google/gemini-2.5-flash"),
schema: z.object({ skus: z.array(z.enum([CATALOG[0].sku, CATALOG[1].sku, CATALOG[2].sku])).min(1) }),
prompt: `Buyer agent for location scouting. Goal: ${data.goal}.\nCatalog: ${JSON.stringify(CATALOG)}.\nPick the smallest set of SKUs that satisfies the goal.`,
});
const items = object.skus.map((s) => CATALOG.find((c) => c.sku === s)!).filter(Boolean);
return ucpEnvelope(items, data.goal, { simulated: false });
});
function ucpEnvelope(items: typeof CATALOG, goal: string, meta: { simulated: boolean; reason?: string }) {
const total_minor = items.reduce((s, i) => s + i.price_minor, 0);
const order_id = `ucp-${crypto.randomUUID()}`;
// RFC 9421-style envelope (signature stub — flag simulated when no real signer).
return {
discovery: { merchant: "location scouting Co.", protocol: "ucp/0.3" },
order: { order_id, items, total_minor, currency: "USD", goal },
signature: { alg: "hmac-sha256", keyid: "demo-key", sig: "stub", covered: "@method @path order" },
meta: { ...meta, kernel: "ucp-checkout" },
};
}
```
CLIENT (in `src/routes/index.tsx`): textarea for the goal + "Run agent" button.
On success render the order line items, total, and pretty-printed JSON envelope.
Show the `simulated: true` flag prominently when demo-fallback is active.
USER FLOW (the entire app — nothing else exists)
1. Land on the page; the headline previews what the agent does for location scouting.
2. The primary action (a one-tap checkout surface that lets an agent shop a fixed catalog and return a verifiable order JSON the user can copy or settle) is one tap away; the rest of the layout supports it.
3. The server fn runs the protocol, the result lands on screen, the user can retry, copy, or audit.
KEYS (Lovable AI first, AIsa AI fallback):
1. `LOVABLE_API_KEY` — PRIMARY agent brain. Auto-provisioned by Lovable. Used
server-side to call Lovable AI Gateway (Gemini, Claude, GPT) for every
reasoning step. Never expose to the client; read only via
`process.env.LOVABLE_API_KEY`. This is the default code path.
2. `AISA_API_KEY` (OPTIONAL FALLBACK) — only set if Lovable credits are
exhausted or a specific frontier model from https://aisa.one is required.
The server fn should try Lovable first and fall back to AIsa only if
`LOVABLE_API_KEY` is missing.
The demo MUST still boot with zero secrets and return realistic `simulated:true`
envelopes — that demo-fallback contract is non-negotiable (see UCP × A2A × AP2 spec).
CREDIT (must appear in UI footer AND as JSDoc on the server function):
Built during the Creative AI & Quantum Hackathon organised by StreetKode Fam during Indian Krump Festival 14
Market sizing.
TAM
$8B
global film and photo location services
SAM
$1.5B
location scouting and permit software
SOM
$40M
automated private property access marketplaces
Indicative figures for hackathon pitches — refine with your own research before raising.
Adjacent entries.
talent booking
Model Release Broker
Lovable AI runs the agent that clears model releases via UCP Checkout so photographers get verifiable talent rights instantly.
equipment logisticsGear Rental Autopilot
Lovable AI runs the agent that reserves camera lenses via UCP Checkout so crews get insured gear without manual paperwork.
rights managementStock License Clearer
Lovable AI runs the agent that purchases editorial usage rights via UCP Checkout so publishers get auditable image licenses instantly.
crew hiringSecond Shooter Booker
Lovable AI runs the agent that hires freelance assistants via UCP Checkout so lead photographers get verified, paid crew backups.