forked from coleam00/Archon
-
Notifications
You must be signed in to change notification settings - Fork 0
feat(archon): add persona service and API routes for agent creation #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
POWERFULMOVES
wants to merge
11
commits into
PMOVES.AI-Edition-Hardened
from
feat/personas-first-architecture
Closed
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a27541d
feat(pmoves): add Claude Code MCP adapter for PMOVES.AI integration
951be3e
chore(security): add CODEOWNERS configuration
385b81b
feat(hardened): Add nested submodule integrations for standalone oper…
POWERFULMOVES d14166c
feat(archon): add persona service and API routes for agent creation
POWERFULMOVES 73bc2c0
fix(pr): Address CodeRabbit PR review comments
POWERFULMOVES da15d05
fix(submodules): Update PMOVES-BoTZ to valid commit on PMOVES.AI-Edit…
POWERFULMOVES b06032d
fix(pr): Address CodeRabbit review issues
POWERFULMOVES 083db59
fix(persona): Fix async/sync blocking calls in persona_service
POWERFULMOVES 8637148
chore(submodules): Update submodule SHAs to latest PMOVES.AI-Edition-…
POWERFULMOVES bd22c3a
chore(submodules): Clean nested submodule state
POWERFULMOVES 4c35b1b
chore: Trigger GitHub merge status recalculation
POWERFULMOVES File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # PMOVES Repository Code Owners | ||
| * @POWERFULMOVES/pmoves-core | ||
| *.py @POWERFULMOVES/pmoves-python | ||
| *.ts @POWERFULMOVES/pmoves-frontend | ||
| *.tsx @POWERFULMOVES/pmoves-frontend | ||
| Dockerfile @POWERFULMOVES/pmoves-infra | ||
| docker-compose*.yml @POWERFULMOVES/pmoves-infra |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "pip" | ||
| directory: "/python" | ||
| schedule: | ||
| interval: "weekly" | ||
| open-pull-requests-limit: 5 | ||
| - package-ecosystem: "npm" | ||
| directory: "/archon-ui-main" | ||
| schedule: | ||
| interval: "weekly" | ||
| open-pull-requests-limit: 5 | ||
| - package-ecosystem: "docker" | ||
| directory: "/python" | ||
| schedule: | ||
| interval: "weekly" | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # PMOVES.AI Core Service Integrations for Archon | ||
| # This enables Archon to run standalone with PMOVES.AI service connections | ||
|
|
||
| # Agent Coordination | ||
| [submodule "external/PMOVES-Agent-Zero"] | ||
| path = external/PMOVES-Agent-Zero | ||
| url = https://github.com/POWERFULMOVES/PMOVES-Agent-Zero.git | ||
| branch = PMOVES.AI-Edition-Hardened | ||
|
|
||
| # MCP Tool Integration | ||
| [submodule "external/PMOVES-BoTZ"] | ||
| path = external/PMOVES-BoTZ | ||
| url = https://github.com/POWERFULMOVES/PMOVES-BoTZ.git | ||
| branch = PMOVES.AI-Edition-Hardened | ||
|
|
||
| # Knowledge Retrieval | ||
| [submodule "external/PMOVES-HiRAG"] | ||
| path = external/PMOVES-HiRAG | ||
| url = https://github.com/POWERFULMOVES/PMOVES-HiRAG.git | ||
| branch = PMOVES.AI-Edition-Hardened | ||
|
|
||
| # Deep Research | ||
| [submodule "external/PMOVES-Deep-Serch"] | ||
| path = external/PMOVES-Deep-Serch | ||
| url = https://github.com/POWERFULMOVES/PMOVES-Deep-Serch.git | ||
| branch = PMOVES.AI-Edition-Hardened | ||
|
|
||
| # Multi-Agent Pro Pack - Document Processing | ||
| [submodule "pmoves_multi_agent_pro_pack/docling"] | ||
| path = pmoves_multi_agent_pro_pack/docling | ||
| url = https://github.com/POWERFULMOVES/docling.git | ||
| branch = PMOVES.AI-Edition-Hardened | ||
|
|
||
| # Multi-Agent Pro Pack - MCP Gateway | ||
| [submodule "pmoves_multi_agent_pro_pack/PMOVES-BotZ-gateway"] | ||
| path = pmoves_multi_agent_pro_pack/PMOVES-BotZ-gateway | ||
| url = https://github.com/POWERFULMOVES/PMOVES-BotZ-gateway.git | ||
|
|
||
| # Multi-Agent Pro Pack - TensorZero Client | ||
| [submodule "pmoves_multi_agent_pro_pack/PMOVES-tensorzero"] | ||
| path = pmoves_multi_agent_pro_pack/PMOVES-tensorzero | ||
| url = https://github.com/POWERFULMOVES/PMOVES-tensorzero.git |
Submodule PMOVES-Agent-Zero
added at
864221
Submodule PMOVES-BoTZ
added at
8461b7
Submodule PMOVES-Deep-Serch
added at
41fa1d
Submodule PMOVES-HiRAG
added at
d5bea1
Submodule PMOVES-BotZ-gateway
added at
b01485
Submodule PMOVES-tensorzero
added at
dcc5c5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| """ | ||
| PMOVES MCP Adapters for Archon | ||
|
|
||
| This module provides MCP (Model Context Protocol) adapters for Archon | ||
| to interact with PMOVES services through Agent Zero. | ||
| """ | ||
|
|
||
| from .claude_code_adapter import ( | ||
| ClaudeCodeMCPAdapter, | ||
| CommandResult, | ||
| ARCHON_MCP_TOOLS, | ||
| create_adapter, | ||
| ) | ||
|
|
||
| __all__ = [ | ||
| "ClaudeCodeMCPAdapter", | ||
| "CommandResult", | ||
| "ARCHON_MCP_TOOLS", | ||
| "create_adapter", | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,265 @@ | ||
| """ | ||
| Claude Code MCP Adapter for Archon | ||
|
|
||
| Integrates Claude Code CLI slash commands into Archon's prompt/form system | ||
| via Agent Zero's MCP interface. | ||
|
|
||
| This adapter enables Archon to: | ||
| - Execute TAC slash commands through Agent Zero | ||
| - Route knowledge queries to appropriate services | ||
| - Access PMOVES infrastructure programmatically | ||
| """ | ||
|
|
||
| import httpx | ||
| import json | ||
| from typing import Dict, Any, List, Optional | ||
| from dataclasses import dataclass | ||
|
|
||
|
|
||
| @dataclass | ||
| class CommandResult: | ||
| """Result from a Claude Code command execution.""" | ||
| success: bool | ||
| output: Any | ||
| stderr: Optional[str] = None | ||
| error: Optional[str] = None | ||
| command: Optional[str] = None | ||
|
|
||
|
|
||
| class ClaudeCodeMCPAdapter: | ||
| """MCP adapter exposing Claude Code commands to Archon via Agent Zero.""" | ||
|
|
||
| def __init__( | ||
| self, | ||
| agent_zero_url: str = "http://agent-zero:8080", | ||
| timeout: float = 30.0 | ||
| ): | ||
| self.agent_zero_url = agent_zero_url | ||
| self.timeout = timeout | ||
| self._client: Optional[httpx.AsyncClient] = None | ||
|
|
||
| @property | ||
| def client(self) -> httpx.AsyncClient: | ||
| """Lazy initialization of async client.""" | ||
| if self._client is None: | ||
| self._client = httpx.AsyncClient(timeout=self.timeout) | ||
| return self._client | ||
|
|
||
| async def close(self): | ||
| """Close the HTTP client.""" | ||
| if self._client: | ||
| await self._client.aclose() | ||
| self._client = None | ||
|
|
||
| async def execute_slash_command( | ||
| self, | ||
| command: str, | ||
| prompt: Optional[str] = None, | ||
| context: Optional[Dict[str, Any]] = None | ||
| ) -> CommandResult: | ||
| """ | ||
| Execute a Claude Code slash command via Agent Zero's MCP interface. | ||
|
|
||
| Args: | ||
| command: Slash command (e.g., "/search:hirag", "/health:check-all") | ||
| prompt: Optional prompt/query for the command | ||
| context: Additional context for execution | ||
|
|
||
| Returns: | ||
| CommandResult with output or error | ||
| """ | ||
| payload = { | ||
| "instrument": "claude_code", | ||
| "action": "execute_command", | ||
| "params": { | ||
| "command": command, | ||
| "prompt": prompt, | ||
| "context": context or {} | ||
| } | ||
| } | ||
|
|
||
| try: | ||
| response = await self.client.post( | ||
| f"{self.agent_zero_url}/mcp/execute", | ||
| json=payload | ||
| ) | ||
| response.raise_for_status() | ||
| data = response.json() | ||
|
|
||
| return CommandResult( | ||
| success=data.get("success", False), | ||
| output=data.get("output") or data.get("stdout"), | ||
| stderr=data.get("stderr"), | ||
| command=data.get("command") | ||
| ) | ||
| except httpx.HTTPStatusError as e: | ||
| return CommandResult( | ||
| success=False, | ||
| output=None, | ||
| error=f"HTTP error: {e.response.status_code}" | ||
| ) | ||
| except Exception as e: | ||
| return CommandResult( | ||
| success=False, | ||
| output=None, | ||
| error=str(e) | ||
| ) | ||
|
|
||
| async def list_available_commands(self) -> List[str]: | ||
| """List all available Claude Code slash commands.""" | ||
| payload = { | ||
| "instrument": "claude_code", | ||
| "action": "list_commands" | ||
| } | ||
|
|
||
| try: | ||
| response = await self.client.post( | ||
| f"{self.agent_zero_url}/mcp/execute", | ||
| json=payload | ||
| ) | ||
| response.raise_for_status() | ||
| data = response.json() | ||
| return data.get("commands", []) | ||
| except Exception: | ||
| return [] | ||
|
|
||
| async def get_command_help(self, command: str) -> Optional[str]: | ||
| """Get help text for a specific command.""" | ||
| payload = { | ||
| "instrument": "claude_code", | ||
| "action": "get_command_help", | ||
| "params": {"command": command} | ||
| } | ||
|
|
||
| try: | ||
| response = await self.client.post( | ||
| f"{self.agent_zero_url}/mcp/execute", | ||
| json=payload | ||
| ) | ||
| response.raise_for_status() | ||
| data = response.json() | ||
| return data.get("help") | ||
| except Exception: | ||
| return None | ||
|
|
||
| # Convenience methods for common operations | ||
|
|
||
| async def search_knowledge(self, query: str) -> CommandResult: | ||
| """Search Hi-RAG v2 knowledge base.""" | ||
| return await self.execute_slash_command("/search:hirag", query) | ||
|
|
||
| async def deep_research(self, topic: str) -> CommandResult: | ||
| """Initiate DeepResearch for complex queries.""" | ||
| return await self.execute_slash_command("/search:deepresearch", topic) | ||
|
|
||
| async def check_health(self) -> CommandResult: | ||
| """Check health of all PMOVES services.""" | ||
| return await self.execute_slash_command("/health:check-all") | ||
|
|
||
| async def get_metrics(self, promql: str = "up") -> CommandResult: | ||
| """Query Prometheus metrics.""" | ||
| return await self.execute_slash_command("/health:metrics", promql) | ||
|
|
||
| async def agent_status(self) -> CommandResult: | ||
| """Check Agent Zero health status.""" | ||
| return await self.execute_slash_command("/agents:status") | ||
|
|
||
| async def mcp_query(self, query: str) -> CommandResult: | ||
| """Query Agent Zero's MCP API directly.""" | ||
| return await self.execute_slash_command("/agents:mcp-query", query) | ||
|
|
||
|
|
||
| # Archon MCP tool registration | ||
| # These definitions tell Archon how to expose Claude Code commands as MCP tools | ||
|
|
||
| ARCHON_MCP_TOOLS = [ | ||
| { | ||
| "name": "claude_code_search", | ||
| "description": "Search PMOVES knowledge base using Claude Code CLI", | ||
| "adapter": "ClaudeCodeMCPAdapter", | ||
| "method": "execute_slash_command", | ||
| "params": { | ||
| "command": { | ||
| "type": "string", | ||
| "enum": ["/search:hirag", "/search:supaserch", "/search:deepresearch"], | ||
| "description": "Search command to execute" | ||
| }, | ||
| "prompt": { | ||
| "type": "string", | ||
| "description": "Search query" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "name": "claude_code_health", | ||
| "description": "Check PMOVES service health using Claude Code CLI", | ||
| "adapter": "ClaudeCodeMCPAdapter", | ||
| "method": "execute_slash_command", | ||
| "params": { | ||
| "command": { | ||
| "type": "string", | ||
| "enum": ["/health:check-all", "/health:metrics"], | ||
| "description": "Health command to execute" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "name": "claude_code_agents", | ||
| "description": "Interact with Agent Zero using Claude Code CLI", | ||
| "adapter": "ClaudeCodeMCPAdapter", | ||
| "method": "execute_slash_command", | ||
| "params": { | ||
| "command": { | ||
| "type": "string", | ||
| "enum": ["/agents:status", "/agents:mcp-query"], | ||
| "description": "Agent command to execute" | ||
| }, | ||
| "prompt": { | ||
| "type": "string", | ||
| "description": "Query for MCP operations (optional)", | ||
| "optional": True | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "name": "claude_code_deploy", | ||
| "description": "Execute deployment operations using Claude Code CLI", | ||
| "adapter": "ClaudeCodeMCPAdapter", | ||
| "method": "execute_slash_command", | ||
| "params": { | ||
| "command": { | ||
| "type": "string", | ||
| "enum": ["/deploy:smoke-test", "/deploy:services", "/deploy:up"], | ||
| "description": "Deploy command to execute" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "name": "claude_code_botz", | ||
| "description": "Manage PMOVES environment using BoTZ commands", | ||
| "adapter": "ClaudeCodeMCPAdapter", | ||
| "method": "execute_slash_command", | ||
| "params": { | ||
| "command": { | ||
| "type": "string", | ||
| "enum": ["/botz:init", "/botz:profile", "/botz:mcp", "/botz:secrets"], | ||
| "description": "BoTZ command to execute" | ||
| }, | ||
| "prompt": { | ||
| "type": "string", | ||
| "description": "Arguments for the command", | ||
| "optional": True | ||
| } | ||
| } | ||
| } | ||
| ] | ||
|
|
||
|
|
||
| # Factory function for Archon integration | ||
| def create_adapter(config: Optional[Dict[str, Any]] = None) -> ClaudeCodeMCPAdapter: | ||
| """Create a configured ClaudeCodeMCPAdapter instance.""" | ||
| config = config or {} | ||
| return ClaudeCodeMCPAdapter( | ||
| agent_zero_url=config.get("agent_zero_url", "http://agent-zero:8080"), | ||
| timeout=config.get("timeout", 30.0) | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: POWERFULMOVES/PMOVES-Archon
Length of output: 804
Dependabot configuration needs directory path corrections.
The configuration won't detect dependencies in the current form. Dependency manifest files are located in subdirectories, not the repository root:
python/pyproject.toml(not detected bypipwith directory/)archon-ui-main/package.jsonanddocs/package.json(not detected bynpmwith directory/)archon-ui-main/,python/, anddocs/(not detected bydockerwith directory/)Update the configuration to add entries targeting the correct directories:
Example corrections
🤖 Prompt for AI Agents