Skip to content

Resolve merge conflicts: add brain/sync-check scripts, dual API key support, and Gemini direct streaming to beauty-assistant#104

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/resolve-merge-conflicts-again
Draft

Resolve merge conflicts: add brain/sync-check scripts, dual API key support, and Gemini direct streaming to beauty-assistant#104
Copilot wants to merge 2 commits into
mainfrom
copilot/resolve-merge-conflicts-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 5, 2026

Merges diverged changes from copilot/fix-merge-conflicts into main across four files. The feature branch added new operational scripts, npm shortcuts, and a significant refactor of the beauty-assistant edge function; main had moved ahead with a newer jsdom version. Conflicts resolved by taking the best of both.

README.md

  • Added SNC (sync:check) documentation section and full Available scripts table

package.json

  • Added health, brain, sync:check npm scripts
  • Kept jsdom@^28.1.0 from main (dropped ^20.0.3 from feature branch)

New scripts

  • scripts/brain-check.js — HTTP GET probe against the beauty-assistant edge function
  • scripts/sync-check.js — parallel probe of frontend /health + beauty-assistant; exits non-zero on any failure

supabase/functions/beauty-assistant/index.ts

  • Added JSDoc header and declare const Deno ambient declaration (fixes TS compiler errors on Deno URL imports; paired with // @ts-expect-error)
  • Replaced all Deno.env.get(...)! non-null assertions with ?? "" / guarded patterns
  • Dual API key support in website chat path: GEMINI_API_KEY ?? LOVABLE_API_KEY
  • Gemini direct streaming (streamGenerateContent SSE) added as a second path when LOVABLE_API_KEY is absent:
if (useLovable) {
  // existing Lovable gateway path (stream: true)
} else {
  // new: Gemini streamGenerateContent → forward as SSE
  const geminiRes = await fetch(
    `https://generativelanguage.googleapis.com/v1beta/models/${model}:streamGenerateContent?key=${apiKey}&alt=sse`,
    ...
  );
}
  • Added null-body guards (if (!response.body) { controller.close(); return; }) before all getReader() calls

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…tant/index.ts; add brain-check.js and sync-check.js scripts

Co-authored-by: asperpharma <252395498+asperpharma@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix merge conflicts in multiple files Resolve merge conflicts: add brain/sync-check scripts, dual API key support, and Gemini direct streaming to beauty-assistant Mar 5, 2026
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.

2 participants