diff --git a/CHANGELOG.md b/CHANGELOG.md index d5bf644..4b69c88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.6.0] - 2026-03-18 20:34 UTC + +### Added +- **SEO Web Audit** — SEO agent can now fetch and analyze live websites + - `/api/fetch-url` route extracts: title, meta tags, headings (h1-h6), links (internal/external), images (alt text coverage), canonical URL, OG tags, text content length + - Auto-detects URLs in user input when SEO agent is active + - Pre-fetches page data before sending to AI for comprehensive audit reports + - Supports up to 2 URLs per request +- **SEO Auto Web Search** — When SEO agent is active and no URL is provided, web search is automatically triggered + - Uses same SearXNG infrastructure as manual web search toggle + - No manual toggle needed in SEO mode +- **Updated SEO Agent Prompt** — All 4 AI services now instruct SEO agent about web audit and search capabilities + - Added `[WEB_AUDIT:url]` and `[WEB_SEARCH:query]` tool markers + - Added "WEB TOOLS" section to system prompts + +### Technical Details +- Files modified: 5 (AIAssist.tsx, qwen-oauth.ts, ollama-cloud.ts, zai-plan.ts, openrouter.ts) +- Files added: 1 (`app/api/fetch-url/route.ts`) +- New API endpoint: `GET /api/fetch-url?url=https://example.com` + ## [1.5.0] - 2026-03-18 20:29 UTC ### Added diff --git a/README.md b/README.md index 7acee7d..1f74f02 100644 --- a/README.md +++ b/README.md @@ -1,179 +1,179 @@ # PromptArch: AI Orchestration Platform -> **Latest Version**: [v1.5.0](CHANGELOG.md#150---2026-03-18) (2026-03-18) - -> **Development Note**: This entire platform was developed exclusively using [TRAE.AI IDE](https://trae.ai) powered by elite [GLM 4.7 model](https://z.ai/subscribe?ic=R0K78RJKNW). -> **Learn more about this architecture [here](https://z.ai/subscribe?ic=R0K78RJKNW).** - ---- - -> **Fork Note**: This project is a specialized fork of [ClavixDev/Clavix](https://github.com/ClavixDev/Clavix), reimagined as a modern web-based platform for visual prompt engineering and product planning. - -Transform vague ideas into production-ready prompts and PRDs. PromptArch is an AI orchestration platform designed for software architects and Vibe Coders, featuring a **plan-first workflow** with multi-provider AI support and live canvas rendering. - -**Developed by Roman | RyzenAdvanced** - -- **Gitea Repository**: [admin/PromptArch](https://github.rommark.dev/admin/PromptArch) -- **Live Site**: [rommark.dev/tools/promptarch](https://rommark.dev/tools/promptarch/) -- **Telegram**: [@VibeCodePrompterSystem](https://t.me/VibeCodePrompterSystem) - -## Core Capabilities - -| Feature | Description | -|---------|-------------| -| **AI Assist** | Plan-first workflow: describe a task, get a structured plan, approve, then generate working code with live preview | -| **Prompt Enhancer** | Refine vague prompts into surgical instructions using 9 enhancement strategies and 11+ intent patterns | -| **PRD Generator** | Convert ideas into structured Product Requirements Documents | -| **Action Plan** | Decompose PRDs into actionable development steps and framework recommendations | -| **Google Ads Generator** | Generate ad campaigns with XLSX and HTML report export | -| **Slides Generator** | Create presentation decks from prompts | -| **Market Researcher** | AI-powered market research and analysis | - -## Features - -### Plan-First Workflow (v1.3.0) -- AI generates a structured plan (architecture, tech stack, files, steps) before any code -- Plan Review Card with **Modify Plan**, **Start Coding**, and **Skip to Code** actions -- After code generation: **Preview** canvas + **Request Modifications** buttons -- Streaming plan mode with real-time parsing and canvas suppression - -### Multi-Provider AI (4 Providers) -| Provider | Auth | Models | -|----------|------|--------| -| **Qwen Code** | OAuth (2,000 free req/day) | Qwen Coder models | -| **Ollama Cloud** | API Key | Open-source models | -| **Z.AI Plan** | API Key | GLM general + coding models | -| **OpenRouter** | API Key | 20+ models (Gemini, Llama, Mistral, etc.) | - -### Visual Canvas -- Live code rendering with `[PREVIEW]` tags -- HTML, React, Python, and more — rendered in-browser -- Auto-detect renderable vs. code-only previews -- Responsive preview with device size selector (Full / Desktop / Tablet / Mobile) - -### Code Review & Web Search -- **Review Code** — Send generated code back to AI for bug/security/performance review -- **Web Search Grounding** — Toggle to enrich prompts with live web search results via SearXNG - -### Enhanced Prompt Engine -- 9 strategies: clarify, add-context, add-constraints, structure, add-examples, set-tone, expand, simplify, chain-of-thought -- Context-aware strategy selection based on detected intent -- 11+ intent detection patterns (coding, creative, analysis, etc.) - -### Other -- Multi-language support (English, Russian, Hebrew) -- Download generated artifacts as ZIP -- Push to GitHub integration -- Resilient multi-tier provider fallbacks - -## Quick Start - -1. **Clone & Install**: - ```bash - git clone https://github.rommark.dev/admin/PromptArch.git - cd PromptArch - npm install - ``` - -2. **Configuration**: - Copy `.env.example` to `.env` and add your API keys: - ```bash - cp .env.example .env - ``` - - Configure at least one provider: - - **Qwen**: Get OAuth credentials from [qwen.ai](https://qwen.ai) - - **Ollama**: Get API key from [ollama.com/cloud](https://ollama.com/cloud) - - **Z.AI**: Get API key from [docs.z.ai](https://docs.z.ai) - - **OpenRouter**: Get API key from [openrouter.ai/keys](https://openrouter.ai/keys) (free tier available) - -3. **Launch**: - ```bash - npm run dev - ``` - -4. Open [http://localhost:3000](http://localhost:3000) to begin. - -## Tech Stack - -- **Framework**: Next.js 15 (App Router, Turbopack) -- **Styling**: Tailwind CSS -- **State Management**: Zustand -- **Components**: shadcn/ui (Radix UI) -- **Icons**: Lucide React -- **Markdown**: react-markdown -- **Language**: TypeScript - -## Project Structure - -``` -promptarch/ - components/ - AIAssist.tsx # Main AI chat with plan-first workflow (1453 lines) - PromptEnhancer.tsx # Prompt enhancement UI with intent detection (556 lines) - SettingsPanel.tsx # Provider configuration and API key management (569 lines) - Sidebar.tsx # Navigation sidebar - GoogleAdsGenerator.tsx # Google Ads campaign generator - PRDGenerator.tsx # Product Requirements Document generator - ActionPlanGenerator.tsx # Action plan decomposition - SlidesGenerator.tsx # Presentation deck generator - MarketResearcher.tsx # Market research tool - HistoryPanel.tsx # Chat history management - lib/ - enhance-engine.ts # Modular prompt enhancement (9 strategies) - store.ts # Zustand state store - artifact-utils.ts # Preview/rendering utilities - export-utils.ts # Export to XLSX/HTML/ZIP - services/ - qwen-oauth.ts # Qwen OAuth streaming service - ollama-cloud.ts # Ollama Cloud streaming service - zai-plan.ts # Z.AI Plan streaming service - openrouter.ts # OpenRouter streaming service - model-adapter.ts # Unified provider adapter - adapter-instance.ts # Provider registry - i18n/ - translations.ts # EN/RU/HE translations - types/ - index.ts # TypeScript interfaces -``` - -## Versioning - -This project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). See [CHANGELOG.md](CHANGELOG.md) for detailed release notes. - -| Version | Date | Highlights | -|---------|------|------------| -| [1.4.0](CHANGELOG.md#140---2026-03-18) | 2026-03-18 19:57 | Review Code button, web search grounding, responsive preview, model selector fix | -| [1.3.0](CHANGELOG.md#130---2026-03-18) | 2026-03-18 18:51 | Plan-first workflow, OpenRouter, post-coding UX, enhanced prompt engine | -| [1.2.0](CHANGELOG.md#120---2026-01-19) | 2026-01-19 19:16 | SEO agent fixes, Z.AI API validation | -| [1.1.0](CHANGELOG.md#110---2025-12-29) | 2025-12-29 17:55 | GitHub push, XLSX/HTML export, OAuth management | -| [1.0.0](CHANGELOG.md#100---2025-12-29) | 2025-12-29 13:51 | Initial release | - -## Development - -```bash -npm install # Install dependencies -npm run dev # Development server (Turbopack) -npm run build # Production build -npm start # Start production server -npm run lint # Lint code -``` - -## Attribution & Credits - -**Author**: Roman | RyzenAdvanced -- **Gitea**: [admin/PromptArch](https://github.rommark.dev/admin/PromptArch) -- **Telegram**: [@VibeCodePrompterSystem](https://t.me/VibeCodePrompterSystem) - -**Forked from**: [ClavixDev/Clavix](https://github.com/ClavixDev/Clavix) -- Visual and architectural evolution of the Clavix framework - -**Development Platform**: [TRAE.AI IDE](https://trae.ai) powered by [GLM 4.7](https://z.ai/subscribe?ic=R0K78RJKNW) - -## License - -ISC - -## Contributing - -Contributions are welcome! Please feel free to submit a Pull Request. +> **Latest Version**: [v1.6.0](CHANGELOG.md#160---2026-03-18) (2026-03-18) + +> **Development Note**: This entire platform was developed exclusively using [TRAE.AI IDE](https://trae.ai) powered by elite [GLM 4.7 model](https://z.ai/subscribe?ic=R0K78RJKNW). +> **Learn more about this architecture [here](https://z.ai/subscribe?ic=R0K78RJKNW).** + +--- + +> **Fork Note**: This project is a specialized fork of [ClavixDev/Clavix](https://github.com/ClavixDev/Clavix), reimagined as a modern web-based platform for visual prompt engineering and product planning. + +Transform vague ideas into production-ready prompts and PRDs. PromptArch is an AI orchestration platform designed for software architects and Vibe Coders, featuring a **plan-first workflow** with multi-provider AI support and live canvas rendering. + +**Developed by Roman | RyzenAdvanced** + +- **Gitea Repository**: [admin/PromptArch](https://github.rommark.dev/admin/PromptArch) +- **Live Site**: [rommark.dev/tools/promptarch](https://rommark.dev/tools/promptarch/) +- **Telegram**: [@VibeCodePrompterSystem](https://t.me/VibeCodePrompterSystem) + +## Core Capabilities + +| Feature | Description | +|---------|-------------| +| **AI Assist** | Plan-first workflow: describe a task, get a structured plan, approve, then generate working code with live preview | +| **Prompt Enhancer** | Refine vague prompts into surgical instructions using 9 enhancement strategies and 11+ intent patterns | +| **PRD Generator** | Convert ideas into structured Product Requirements Documents | +| **Action Plan** | Decompose PRDs into actionable development steps and framework recommendations | +| **Google Ads Generator** | Generate ad campaigns with XLSX and HTML report export | +| **Slides Generator** | Create presentation decks from prompts | +| **Market Researcher** | AI-powered market research and analysis | + +## Features + +### Plan-First Workflow (v1.3.0) +- AI generates a structured plan (architecture, tech stack, files, steps) before any code +- Plan Review Card with **Modify Plan**, **Start Coding**, and **Skip to Code** actions +- After code generation: **Preview** canvas + **Request Modifications** buttons +- Streaming plan mode with real-time parsing and canvas suppression + +### Multi-Provider AI (4 Providers) +| Provider | Auth | Models | +|----------|------|--------| +| **Qwen Code** | OAuth (2,000 free req/day) | Qwen Coder models | +| **Ollama Cloud** | API Key | Open-source models | +| **Z.AI Plan** | API Key | GLM general + coding models | +| **OpenRouter** | API Key | 20+ models (Gemini, Llama, Mistral, etc.) | + +### Visual Canvas +- Live code rendering with `[PREVIEW]` tags +- HTML, React, Python, and more — rendered in-browser +- Auto-detect renderable vs. code-only previews +- Responsive preview with device size selector (Full / Desktop / Tablet / Mobile) + +### Code Review & Web Search +- **Review Code** — Send generated code back to AI for bug/security/performance review +- **Web Search Grounding** — Toggle to enrich prompts with live web search results via SearXNG + +### Enhanced Prompt Engine +- 9 strategies: clarify, add-context, add-constraints, structure, add-examples, set-tone, expand, simplify, chain-of-thought +- Context-aware strategy selection based on detected intent +- 11+ intent detection patterns (coding, creative, analysis, etc.) + +### Other +- Multi-language support (English, Russian, Hebrew) +- Download generated artifacts as ZIP +- Push to GitHub integration +- Resilient multi-tier provider fallbacks + +## Quick Start + +1. **Clone & Install**: + ```bash + git clone https://github.rommark.dev/admin/PromptArch.git + cd PromptArch + npm install + ``` + +2. **Configuration**: + Copy `.env.example` to `.env` and add your API keys: + ```bash + cp .env.example .env + ``` + + Configure at least one provider: + - **Qwen**: Get OAuth credentials from [qwen.ai](https://qwen.ai) + - **Ollama**: Get API key from [ollama.com/cloud](https://ollama.com/cloud) + - **Z.AI**: Get API key from [docs.z.ai](https://docs.z.ai) + - **OpenRouter**: Get API key from [openrouter.ai/keys](https://openrouter.ai/keys) (free tier available) + +3. **Launch**: + ```bash + npm run dev + ``` + +4. Open [http://localhost:3000](http://localhost:3000) to begin. + +## Tech Stack + +- **Framework**: Next.js 15 (App Router, Turbopack) +- **Styling**: Tailwind CSS +- **State Management**: Zustand +- **Components**: shadcn/ui (Radix UI) +- **Icons**: Lucide React +- **Markdown**: react-markdown +- **Language**: TypeScript + +## Project Structure + +``` +promptarch/ + components/ + AIAssist.tsx # Main AI chat with plan-first workflow (1453 lines) + PromptEnhancer.tsx # Prompt enhancement UI with intent detection (556 lines) + SettingsPanel.tsx # Provider configuration and API key management (569 lines) + Sidebar.tsx # Navigation sidebar + GoogleAdsGenerator.tsx # Google Ads campaign generator + PRDGenerator.tsx # Product Requirements Document generator + ActionPlanGenerator.tsx # Action plan decomposition + SlidesGenerator.tsx # Presentation deck generator + MarketResearcher.tsx # Market research tool + HistoryPanel.tsx # Chat history management + lib/ + enhance-engine.ts # Modular prompt enhancement (9 strategies) + store.ts # Zustand state store + artifact-utils.ts # Preview/rendering utilities + export-utils.ts # Export to XLSX/HTML/ZIP + services/ + qwen-oauth.ts # Qwen OAuth streaming service + ollama-cloud.ts # Ollama Cloud streaming service + zai-plan.ts # Z.AI Plan streaming service + openrouter.ts # OpenRouter streaming service + model-adapter.ts # Unified provider adapter + adapter-instance.ts # Provider registry + i18n/ + translations.ts # EN/RU/HE translations + types/ + index.ts # TypeScript interfaces +``` + +## Versioning + +This project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). See [CHANGELOG.md](CHANGELOG.md) for detailed release notes. + +| Version | Date | Highlights | +|---------|------|------------| +| [1.4.0](CHANGELOG.md#140---2026-03-18) | 2026-03-18 19:57 | Review Code button, web search grounding, responsive preview, model selector fix | +| [1.3.0](CHANGELOG.md#130---2026-03-18) | 2026-03-18 18:51 | Plan-first workflow, OpenRouter, post-coding UX, enhanced prompt engine | +| [1.2.0](CHANGELOG.md#120---2026-01-19) | 2026-01-19 19:16 | SEO agent fixes, Z.AI API validation | +| [1.1.0](CHANGELOG.md#110---2025-12-29) | 2025-12-29 17:55 | GitHub push, XLSX/HTML export, OAuth management | +| [1.0.0](CHANGELOG.md#100---2025-12-29) | 2025-12-29 13:51 | Initial release | + +## Development + +```bash +npm install # Install dependencies +npm run dev # Development server (Turbopack) +npm run build # Production build +npm start # Start production server +npm run lint # Lint code +``` + +## Attribution & Credits + +**Author**: Roman | RyzenAdvanced +- **Gitea**: [admin/PromptArch](https://github.rommark.dev/admin/PromptArch) +- **Telegram**: [@VibeCodePrompterSystem](https://t.me/VibeCodePrompterSystem) + +**Forked from**: [ClavixDev/Clavix](https://github.com/ClavixDev/Clavix) +- Visual and architectural evolution of the Clavix framework + +**Development Platform**: [TRAE.AI IDE](https://trae.ai) powered by [GLM 4.7](https://z.ai/subscribe?ic=R0K78RJKNW) + +## License + +ISC + +## Contributing + +Contributions are welcome! Please feel free to submit a Pull Request. diff --git a/app/api/fetch-url/route.ts b/app/api/fetch-url/route.ts new file mode 100644 index 0000000..9e95153 --- /dev/null +++ b/app/api/fetch-url/route.ts @@ -0,0 +1,117 @@ +/** + * Next.js API route: Fetch URL content for SEO/web auditing. + * Endpoint: GET /api/fetch-url?url=https://example.com + * Returns: { title, meta, headings, text, links, status } + */ + +import { NextRequest, NextResponse } from "next/server"; + +export async function GET(request: NextRequest) { + const targetUrl = request.nextUrl.searchParams.get("url"); + + if (!targetUrl) { + return NextResponse.json({ error: "URL parameter required" }, { status: 400 }); + } + + try { + new URL(targetUrl); + } catch { + return NextResponse.json({ error: "Invalid URL" }, { status: 400 }); + } + + try { + const controller = new AbortController(); + const timeout = setTimeout(() => controller.abort(), 12000); + + const res = await fetch(targetUrl, { + signal: controller.signal, + headers: { + "User-Agent": "PromptArch-SEO-Bot/1.5 (https://rommark.dev)", + Accept: "text/html,application/xhtml+xml,text/plain;q=0.9", + }, + }); + clearTimeout(timeout); + + if (!res.ok) { + return NextResponse.json({ error: `HTTP ${res.status}`, status: res.status }); + } + + const html = await res.text(); + + const titleMatch = html.match(/