diff --git a/.gitignore b/.gitignore index d652275..713d2f4 100644 --- a/.gitignore +++ b/.gitignore @@ -183,3 +183,5 @@ config/ codetide/agents/tide/ui/assets/ examples/hf_demo_space/.chainlit/* examples/hf_demo_space/chainlit.md + +examples/hf_demo_space/public/ diff --git a/codetide/agents/tide/ui/app.py b/codetide/agents/tide/ui/app.py index 16a71ef..8a78efc 100644 --- a/codetide/agents/tide/ui/app.py +++ b/codetide/agents/tide/ui/app.py @@ -146,7 +146,7 @@ async def loadAgentTideUi()->AgentTideUi: agent_tide_ui = AgentTideUi( os.getenv("AGENT_TIDE_PROJECT_PATH", "./"), history=cl.user_session.get("chat_history"), - llm_config=cl.user_session.get("settings") + llm_config=cl.user_session.get("settings") or None ) await agent_tide_ui.load() diff --git a/examples/hf_demo_space/Dockerfile b/examples/hf_demo_space/Dockerfile index 8ecd176..ae9ed28 100644 --- a/examples/hf_demo_space/Dockerfile +++ b/examples/hf_demo_space/Dockerfile @@ -28,4 +28,4 @@ RUN pip install --upgrade pip && \ EXPOSE 7860 -CMD python -m chainlit run app.py --host 0.0.0.0 --port 7860 \ No newline at end of file +CMD uvicorn api:app --host 0.0.0.0 --port 7860 diff --git a/examples/hf_demo_space/api.py b/examples/hf_demo_space/api.py new file mode 100644 index 0000000..23aef67 --- /dev/null +++ b/examples/hf_demo_space/api.py @@ -0,0 +1,54 @@ +from fastapi.responses import HTMLResponse, FileResponse +from fastapi.templating import Jinja2Templates +from fastapi.staticfiles import StaticFiles +from fastapi import FastAPI, Request +from chainlit.utils import mount_chainlit +from pathlib import Path +import os + +ROOT_PATH = os.getenv("API_ROOT_PATH", "./") +app = FastAPI(title="AgentTide", description="Precision-Driven Software Engineering Agent") + +# Mount static files directory for assets (logo, CSS, JS, etc.) +app.mount("/static", StaticFiles(directory=F"{ROOT_PATH}/public"), name="static") + +templates = Jinja2Templates(directory=F"{ROOT_PATH}/static") + +@app.get("/", response_class=HTMLResponse) +async def landing_page(request: Request): + """Serve the AgentTide landing page""" + return templates.TemplateResponse("landing_page.html", {"request": request}) + +@app.get("/health") +async def health_check(): + """Health check endpoint""" + return {"status": "healthy", "service": "AgentTide"} + +@app.get("/favicon.ico", include_in_schema=False) +async def favicon(): + """Serve favicon""" + favicon_path = Path(F"{ROOT_PATH}/public/favicon.ico") + if favicon_path.exists(): + return FileResponse(favicon_path) + else: + # Return 204 No Content if favicon doesn't exist + return HTMLResponse(status_code=204) + +@app.get("/logo_dark.png", include_in_schema=False) +async def logo_dark(): + """Serve favicon""" + favicon_path = Path(F"{ROOT_PATH}/public/logo_dark.png") + if favicon_path.exists(): + return FileResponse(favicon_path) + else: + # Return 204 No Content if favicon doesn't exist + return HTMLResponse(status_code=204) + +mount_chainlit(app=app, target=F"{ROOT_PATH}/app.py", path="/tide") + +if __name__ == "__main__": + from dotenv import load_dotenv + import uvicorn + + load_dotenv() + uvicorn.run(app, host="0.0.0.0", port=7860) diff --git a/examples/hf_demo_space/app.py b/examples/hf_demo_space/app.py index bc206b6..5a2b9cf 100644 --- a/examples/hf_demo_space/app.py +++ b/examples/hf_demo_space/app.py @@ -40,17 +40,7 @@ async def start_chatr(): cl.user_session.set("session_id", session_id) await cl.context.emitter.set_commands(AgentTideUi.commands) cl.user_session.set("chat_history", []) - - await cl.Message( - content="", - elements=[ - cl.Image( - path=os.getenv("AGENT_TIDE_LOGO_PATH"), - size="large" - ) - ] - ).send() - + exception = True while exception: try: @@ -113,7 +103,7 @@ async def start_chatr(): agent_tide_ui = AgentTideUi( DEFAULT_SESSIONS_WORKSPACE / session_id, history=cl.user_session.get("chat_history"), - llm_config=cl.user_session.get("settings"), + llm_config=cl.user_session.get("settings") or None, session_id=session_id ) await agent_tide_ui.load() diff --git a/examples/hf_demo_space/requirements.txt b/examples/hf_demo_space/requirements.txt index 2e16027..702f9c8 100644 --- a/examples/hf_demo_space/requirements.txt +++ b/examples/hf_demo_space/requirements.txt @@ -1 +1,2 @@ -codetide @ git+https://github.com/BrunoV21/codetide.git#egg=codetide[agents-ui] \ No newline at end of file +codetide @ git+https://github.com/BrunoV21/codetide.git#egg=codetide[agents-ui] +fastapi==0.115.7 \ No newline at end of file diff --git a/examples/hf_demo_space/static/landing_page.html b/examples/hf_demo_space/static/landing_page.html new file mode 100644 index 0000000..3667023 --- /dev/null +++ b/examples/hf_demo_space/static/landing_page.html @@ -0,0 +1,685 @@ + + + + + + AgentTide - Precision-Driven Software Engineering Agent + + + + +
+
function analyzeCode() { return insights; }
+
const agent = new AgentTide();
+
// Precision-driven refactoring
+
import { structuralAnalysis } from 'codetide';
+
+ + + +
+
+ +
+
+ +
+
+

AI Agents for Smarter Codebases

+

+ The next-generation, precision-driven software engineering agent built on top of CodeTide. + Experience intelligent code generation with full structural understanding of your codebase. +

+ + + +
+ $ uvx --from codetide[agents-ui] agent-tide-ui +
+
+
+ +
+
+
+
+ 🧠 +

Understands Your Codebase

+

Deep structural analysis of your entire project for context-aware modifications

+
+ +
+ +

Intelligent Refactoring

+

Automated code improvements that maintain functionality while enhancing quality

+
+ +
+ 🔗 +

Seamless GitHub Integration

+

Direct repository analysis and patch generation with full version control support

+
+ +
+ 🌊 +

CodeTide MCP Support

+

Empower AI agents and tools with dynamic codebase interaction while keeping your data secure.

+
+
+
+
+ +
+ +
+
+

Why Choose AgentTide?

+

Experience the power of context-aware, privacy-first software engineering

+ +
+
+
🔒
+

Local-First & Private

+

All code analysis and patching is performed locally. Your code never leaves your machine, ensuring complete privacy and security.

+
+ +
+
👁️
+

Transparent & Stepwise

+

See every plan and patch before it's applied. Edit, reorder, or approve steps-you're always in control of the process.

+
+ +
+
🧠
+

Context-Aware

+

AgentTide loads only the relevant code identifiers and dependencies for your request, making it fast and precise.

+
+ +
+
🤝
+

Human-in-the-Loop

+

After each step, review the patch, provide feedback, or continue-no black-box agent behavior.

+
+ +
+
+

Patch-Based Editing

+

All changes are atomic diffs, not full file rewrites, for maximum clarity and efficiency.

+
+ +
+
🎯
+

Precision-Driven

+

Built on CodeTide's symbolic code understanding for accurate, context-aware code modifications.

+
+
+
+
+ + + + + + \ No newline at end of file