# Website Generator — source module

This adds a module to an existing Agent OS Next.js app. It is not a complete Agent OS distribution. Tested in the author's current local app, not as a clean installation against every member version. Requires the app's config.codex export, path alias @/*, lucide-react and standard Next/React dependencies already present in Agent OS. Requires Python 3.9+ and an authenticated Codex CLI for fresh content. Existing account usage limits apply.

1. Back up or commit the target app. Inspect its instructions and the files supplied here. Merge new files into matching paths. Preserve existing files and user changes.
2. Reuse src/lib/config.ts and its config.codex executable path. Do not replace config.ts. The source package deliberately excludes private machine configuration. If the app has no equivalent, ask the coding agent to adapt its existing connection flow.
3. Reuse src/lib/designOrigin.ts if present; supplied implementation is a reference for apps missing it.
4. Merge this item into Sidebar.tsx's navigation collection (LayoutDashboard is already imported in the tested app):

```tsx
{ href: "/website-generator", label: "Website Generator", icon: <LayoutDashboard size={16} />, accent: "#a3c68c", dim: "rgba(163,198,140,0.16)" },
```

Merge this entry into TopBar.tsx's route-title map:

```tsx
"/website-generator": { numeral: "X.", label: "Create · Local Websites", title: "Website Generator", sub: "Build, preview and export local service websites." },
```

5. Run from the app root:

```sh
python3 scripts/website-generator/test_worker.py
npx tsc --noEmit
npm run dev -- --port 3737
```

If the app already runs, use that process and port. Open http://127.0.0.1:3737/website-generator and click Open patio example. After Draft ready appears, run in another terminal:

```sh
AGENT_OS_URL=http://127.0.0.1:3737 node scripts/website-generator-check.cjs
```

6. Generate one fictional brief through the UI. Fresh content uses the configured Codex CLI account. Verify service links, mobile view, saved history after reload, notes and ZIP contents. This last check needs a working writer account; the Python tests use a stub for writer failure handling.

Saved drafts live in ~/.agentic-os/website-generator. The included source contains no saved jobs or account settings. One job runs at a time. Keep the computer awake. A build can continue when leaving the page but needs the local system running.

Hosting, real enquiry delivery, a real domain, verified operator details, image permissions and recurring SEO need separate setup and testing. Previews stay noindex. Included images are AI concepts, not completed projects. The included weekly notes are a workflow document, not an enabled scheduler.


## Design OS tab integration

Import WebsiteGenerator in src/components/DesignOS.tsx. Add website-generator to the allowed view query values and add ["website-generator", "Website Generator"] to the existing tab buttons. Render <WebsiteGenerator/> for this tab before checking whether the Design OS library has loaded. Preserve all existing tabs. Add flex-wrap:wrap to the tab navigation so it fits mobile screens. The deep link is /design-os?view=website-generator. The standalone /website-generator route still works.
