# Hyperchat 1.7.0 — funnels and guided creation

Extract this release into a separate folder. Do not overwrite a customized
installation or run fresh-install setup on it. Back up your current source,
configuration, and database. Keep the untouched previous release for comparison.

## Prompt for your coding agent

> Read UPGRADE_1.7.0.md and the guides for my installed baseline. Compare my customized installation, the untouched previous release, and this release with scripts/plan-upgrade.mjs. Merge by feature in an isolated checkout while preserving my branding, authentication, navigation, roles, schema extensions, integrations, provider settings, secrets, and data. Do not replace folders or run fresh-install setup. Deploy my merged Convex backend before my frontend, using only my own deployment. Keep existing workflows and publication settings unchanged. Validate public funnel SEO, permissions, draft publication, forms, and attribution on my domain. Configure optional AI only with my chosen key/model and spending limits. Never treat a simulated preview as a real lead or booking.

## Baselines

- **1.6.0:** merge the funnel feature map below.
- **1.5.3 or earlier:** also read the intermediate upgrade guides, including
  UPGRADE_1.6.0.md. This archive is the complete app, not a patch to copy blindly.
- **Unknown:** omit `--baseline` and review every conflict manually.

```sh
node scripts/plan-upgrade.mjs --installed /path/to/current --baseline /path/to/untouched-old-release --incoming /path/to/hyperchat-1.7.0 > upgrade-plan.json
```

The planner is read-only. It never overwrites or removes your files.

## Feature map

1. **Data and permissions:** merge `convex/funnels.ts`, `funnelAI.ts`,
   `funnelModel.ts` and additive `funnels`, `funnelLeads`, `funnelLimits` schema
   definitions/indexes. Preserve workspace membership and admin-only publishing.
2. **Editor and library:** merge `src/components/funnel-*.tsx`,
   `src/components/public-funnel.tsx`, `src/lib/funnel-*.ts`, `funnels.ts`,
   `legacy-funnel-templates.ts`, and the Funnels navigation/manager integrations
   in `studio.tsx`, `connected-studio.tsx`, and `workspace-navigation.tsx`.
3. **Routes and styles:** merge `src/app/demo/funnels`, `f`, `funnel-preview`,
   `robots.ts`, `sitemap.xml`, the workspace/demo layouts and stylesheet loader,
   `funnels.css`, `funnel-public.css`, `funnel-preview.css`, `workspace.css`,
   `layout.tsx`, and `next.config.ts`. Public pages must not load workspace CSS.
   Preserve your own routes and robots/sitemap entries; combine rather than
   replace them. Keep internal/demo/preview pages noindex.
4. **Assets:** include `public/funnel-assets`, `public/funnel-previews`, and the
   added fonts and license notices in `public/fonts`. These are runtime assets.
5. **Guidance:** read `docs/FUNNELS.md`, `FUNNEL_GUIDED_CREATOR.md`,
   `FUNNEL_PREVIEW.md`, and `FUNNEL_SEO.md`. The guided creator uses no AI key;
   generation/rewriting uses your existing workspace OpenRouter settings.

## Deploy and verify

Deploy the backend before the frontend. Use only your own configured Convex
deployment. Preserve your Zernio, auth, email, OpenRouter, and webhook settings.
No provider configuration needs to be reset for this update.

Set `NEXT_PUBLIC_SITE_URL` to your complete public HTTPS origin before building.
Keep your matching `NEXT_PUBLIC_CONVEX_URL` and `NEXT_PUBLIC_CONVEX_SITE_URL`.
Without a valid public origin, search discovery stays disabled. Already-published
funnels must be republished to populate the discovery index if your prior custom
implementation did not maintain it. Saving later changes keeps the live snapshot
unchanged until you explicitly publish again.

```sh
pnpm install --frozen-lockfile
pnpm check
```

Verify existing inbox/automation/publishing workflows, then test a funnel draft,
guided creation, manual edit/save/reload, desktop/mobile private preview, admin
publish/unpublish, and a consented test submission with your own synthetic details.
Confirm the contact and campaign attribution appear in the right workspace.
Check the public title/canonical, robots, sitemap, sharing image, and follow-up
noindex on your domain. Test your optional AI model separately before relying on it.

Private previews simulate forms and never store contacts. Checkout/calendar links
remain external destinations you supply. The release does not add native payments,
bookings, automatic resource delivery, custom funnel domains, or split testing.
