From 5b7df2f073c08e94d4937d56815e08cadd55e24e Mon Sep 17 00:00:00 2001 From: Keysat Date: Sat, 13 Jun 2026 12:02:36 -0500 Subject: [PATCH] Complete client-side relay contract in AGENTS.md Add the /relay/* endpoints the app actually calls that were omitted (capabilities, policy, tts, jobs/:id, credits/*); fix the Files attribution (add relay-capabilities.js + credits-purchase.js; the /relay/policy proxy lives in index.js only). --- AGENTS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 2207a6d..107d698 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -87,8 +87,8 @@ Endpoint shapes + auth model are documented canonically in `../recap-relay/AGENT - **Env vars** — `RECAP_RELAY_BASE_URL` (default `https://relay.recaps.cc`) + `RECAP_RELAY_OPERATOR_KEY` (matches the relay's `relay_cloud_operator_key`). Both gitignored; reference names, never values. Resolved in `server/relay-default.js` and `server/config.js`. - **Auth direction (what the client SENDS)** — cloud calls send `X-Recap-Operator-Key` + `X-Recap-User-Id`; self-hosted calls send `X-Recap-Install-Id` (+ optional `Authorization: `). Set the same `X-Recap-Job-Id` on transcribe + analyze in one summary so the relay bills one credit, not two. -- **Endpoints called** — `/relay/{transcribe, transcribe-url, summarize-url, summarize-url/:jobId/events, analyze, balance, user-tier, user-tier/:id, tier-invoice, tier-zaprite-order, tier-plans, expiring-subscriptions}`. Settle webhooks land on the relay side, never here. -- **Files** — `server/providers/relay.js` (transcribe/summarize/analyze + tier reads/writes), `server/billing-routes.js` (purchase orchestration), `server/subscription-reminders.js` (polls `/relay/expiring-subscriptions`). +- **Endpoints called** — `/relay/{transcribe, transcribe-url, jobs/:id, summarize-url, summarize-url/:jobId/events, analyze, tts, balance, capabilities, policy, credits/packages, credits/buy, credits/invoice/:id, user-tier, user-tier/:id, tier-invoice, tier-zaprite-order, tier-plans, expiring-subscriptions}`. Settle webhooks land on the relay side, never here. +- **Files** — `server/providers/relay.js` (transcribe/summarize/analyze/tts + balance + tier reads/writes), `server/relay-capabilities.js` (capabilities poll), `server/billing-routes.js` (tier purchase orchestration), `server/credits-purchase.js` (credit-pack purchase proxy), `server/subscription-reminders.js` (polls `/relay/expiring-subscriptions`). (`/relay/policy` is a small inline proxy in `index.js`.) ## Always