Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 3 additions & 30 deletions config/agent_network.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@
"version": "1.0",
"created": "2025-11-26T13:03:17.327966",
"mcp_servers": {
"youtube-extension": {
"endpoint": "http://127.0.0.1:8010",
"tools": [
"process_video_markdown",
"get_transcript",
"analyze_video"
]
},
"gemini-code-gen": {
"endpoint": "internal://ai_code_generator",
"tools": [
"generate_fullstack",
"determine_architecture",
"generate_files"
]
},
"github-deploy": {
"endpoint": "mcp://github",
"tools": [
Expand Down Expand Up @@ -69,11 +53,7 @@
"id": "video-ingest",
"name": "Video Ingest Agent",
"role": "Extract and analyze video content",
"tools": [
"process_video_markdown",
"get_transcript",
"analyze_video"
],
"tools": [],
"capabilities": [
"youtube_processing",
"transcript_extraction",
Expand All @@ -85,7 +65,6 @@
"name": "Architecture Agent",
"role": "Determine tech stack and project structure",
"tools": [
"determine_architecture",
"get_context",
"get_capabilities"
],
Expand All @@ -100,8 +79,6 @@
"name": "Code Generation Agent",
"role": "Generate application code from specifications",
"tools": [
"generate_fullstack",
"generate_files",
"get_error_patterns"
],
"capabilities": [
Expand Down Expand Up @@ -302,9 +279,7 @@
"id": "content-generation",
"name": "Content Generation Skill",
"role": "Generate blog/social posts from video transcripts",
"tools": [
"generate_fullstack"
],
"tools": [],
"capabilities": [
"content_generation",
"blog_posts",
Expand All @@ -319,9 +294,7 @@
"id": "seo-optimizer",
"name": "SEO Optimizer Skill",
"role": "Optimize video titles, descriptions, tags for search discoverability",
"tools": [
"analyze_video"
],
"tools": [],
"capabilities": [
"seo_optimization",
"metadata_enhancement"
Expand Down
41 changes: 0 additions & 41 deletions src/agents/enhanced_video_processor.py

This file was deleted.

76 changes: 6 additions & 70 deletions src/agents/mcp_agent_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,6 @@
"version": "1.0",
"created": datetime.now().isoformat(),
"mcp_servers": {
"youtube-extension": {
"endpoint": "http://127.0.0.1:8010",
"tools": ["process_video_markdown", "get_transcript", "analyze_video"]
},
"gemini-code-gen": {
"endpoint": "internal://ai_code_generator",
"tools": ["generate_fullstack", "determine_architecture", "generate_files"]
},
"github-deploy": {
"endpoint": "mcp://github",
"tools": ["create_repo", "push_code", "create_pr"]
Expand All @@ -91,21 +83,21 @@
"id": "video-ingest",
"name": "Video Ingest Agent",
"role": "Extract and analyze video content",
"tools": ["process_video_markdown", "get_transcript", "analyze_video"],
"tools": [],
"capabilities": ["youtube_processing", "transcript_extraction", "content_analysis"]
},
{
"id": "architect",
"name": "Architecture Agent",
"role": "Determine tech stack and project structure",
"tools": ["determine_architecture", "get_context", "get_capabilities"],
"tools": ["get_context", "get_capabilities"],
"capabilities": ["architecture_design", "tech_selection", "knowledge_integration"]
},
{
"id": "code-gen",
"name": "Code Generation Agent",
"role": "Generate application code from specifications",
"tools": ["generate_fullstack", "generate_files", "get_error_patterns"],
"tools": ["get_error_patterns"],
"capabilities": ["code_generation", "fullstack_apps", "template_application"]
},
{
Expand Down Expand Up @@ -206,14 +198,10 @@

# Route to actual internal tools
try:
if module_name == "ai_code_generator":
return await self._call_code_generator(action, payload)
elif module_name == "skill_builder":
if module_name == "skill_builder":
return await self._call_skill_builder(action, payload)
elif module_name == "knowledge_base":
if module_name == "knowledge_base":
return await self._call_knowledge_base(action, payload)
else:
return {"status": "routed", "module": module_name, "action": action}
except Exception as e:
return {"error": f"Internal tool error: {str(e)}"}

Expand All @@ -227,65 +215,13 @@
"""Call HTTP endpoint"""
logger.info(f"HTTP call: {endpoint}/{action}")

# Route to YouTube extension (HTTP server at 127.0.0.1:8010)
if endpoint.startswith("http://127.0.0.1:8010"):
try:
from .mcp_tools import get_youtube_tool
youtube_tool = get_youtube_tool()

# Route to specific tool method
if action == "process_video_markdown":
return await youtube_tool.process_video_markdown(**payload)
elif action == "get_transcript":
return await youtube_tool.get_transcript(**payload)
elif action == "analyze_video":
return await youtube_tool.analyze_video(**payload)

except Exception as e:
logger.error(f"YouTube tool error: {e}")
return {"error": f"YouTube tool error: {str(e)}"}

# Route to Vercel API
elif endpoint.startswith("https://api.vercel.com"):
if endpoint.startswith("https://api.vercel.com"):
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
return await self._call_vercel_api(action, payload)

return {"status": "routed", "endpoint": endpoint, "action": action}

def get_pipeline_agents(self) -> list[str]:
"""Get ordered list of agents for video-to-software pipeline"""
return ["video-ingest", "architect", "code-gen", "build-validator", "deployer", "knowledge-capture"]

async def _call_code_generator(self, action: str, payload: dict) -> dict:
"""Call AI code generator (Gemini 3)"""
logger.info(f"Code generator call: {action}")

try:
# Import existing AI code generator
from youtube_extension.backend.ai_code_generator import AICodeGenerator
generator = AICodeGenerator()

# Route to specific method
if action == "generate_fullstack":
# Use existing generate_fullstack_project method
video_analysis = payload.get("video_analysis", {})
architecture = payload.get("architecture", {})

project_config = {
"type": architecture.get("app_type", "web_app"),
"features": architecture.get("features", []),
"title": video_analysis.get("metadata", {}).get("title", "Generated App")
}

result = await generator.generate_fullstack_project(video_analysis, project_config)
return {"status": "success", **result}

else:
return {"status": "unknown_action", "action": action}

except Exception as e:
logger.error(f"AI code generator error: {e}")
return {"error": f"Code generator error: {str(e)}"}

async def _call_skill_builder(self, action: str, payload: dict) -> dict:
"""Call skill builder and build validator"""
logger.info(f"Skill builder call: {action}")
Expand Down
23 changes: 0 additions & 23 deletions src/agents/mcp_ecosystem_coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,30 +435,7 @@ def _load_skill_instance(self, skill_id: str) -> Any:
module = importlib.import_module(module_path)
skill_class = getattr(module, class_name)

# Resolve dependencies from the service container. Imported lazily to
# avoid a circular import at module load time, and guarded so that a
# container import failure (e.g. a missing optional transitive dep)
# degrades to no injection instead of breaking every skill invocation.
dependencies: dict[str, Any] = {}
try:
from youtube_extension.backend.containers.service_container import (
get_service,
)
except Exception as e:
logger.warning(
"Service container unavailable; skipping DI for skill %s: %s",
skill_id,
e,
)
get_service = None

if get_service is not None:
for dep_name in meta.get("dependencies", []):
try:
dependencies[dep_name] = get_service(dep_name)
except Exception as e:
logger.warning("Failed to resolve dependency %s for skill %s: %s", dep_name, skill_id, e)

instance = skill_class(dependencies=dependencies)
self._instances[skill_id] = instance
return instance
Expand Down
30 changes: 1 addition & 29 deletions src/agents/pipeline_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,6 @@ async def _run_sequential_pipeline(self, video_url: str, options: dict) -> dict:
"total_duration_ms": report["total_duration_ms"]
})

# Deeper unclosed hygiene: explicit close of LLM router / Gemini clients (LLM fallback paths)
try:
from youtube_extension.backend.llm_router import LLMRouter
# If any were created in this process, best-effort new instance close does nothing harmful
# Real instances are closed by owners; this helps GC in long-lived launcher
pass
except Exception:
pass

return report

async def _run_dag_pipeline(self, video_url: str, options: dict) -> dict:
Expand Down Expand Up @@ -669,26 +660,7 @@ def _vera_record_proof(
def _prepare_agent_action(self, agent_id: str) -> tuple:
"""Prepare action and payload for agent based on pipeline state"""

if agent_id == "video-ingest":
return "process_video_markdown", {
"video_url": self.pipeline_state.get("video_url"),
"extract_transcript": True,
"analyze_content": True
}

elif agent_id == "architect":
return "determine_architecture", {
"video_analysis": self.pipeline_state.get("video-ingest_output", {}),
"use_knowledge_context": True
}

elif agent_id == "code-gen":
return "generate_fullstack", {
"architecture": self.pipeline_state.get("architect_output", {}),
"video_analysis": self.pipeline_state.get("video-ingest_output", {})
}

elif agent_id == "build-validator":
if agent_id == "build-validator":
return "get_error_patterns", {
"generated_code": self.pipeline_state.get("code-gen_output", {}),
"run_build": True
Expand Down
20 changes: 0 additions & 20 deletions src/agents/prompts/debug_prompts.js

This file was deleted.

Loading
Loading