diff --git a/eve/__init__.py b/eve/__init__.py index 10421a0..9e1c7a2 100644 --- a/eve/__init__.py +++ b/eve/__init__.py @@ -47,9 +47,22 @@ def load_env(db): os.environ["DB"] = db # First try ~/.eve - stage = db == "STAGE" - env_file = ".env.STAGE" if stage else ".env" - eve_file = ".eve.STAGE" if stage else ".eve" + env_file = ( + ".env.STAGE" if db == "STAGE" else + ".env.PROD" if db == "PROD" else + ".env.WEB3-STAGE" if db == "WEB3-STAGE" else + ".env.WEB3-PROD" if db == "WEB3-PROD" else + ".env.STAGE" + ) + + eve_file = ( + ".eve.STAGE" if db == "STAGE" else + ".eve.PROD" if db == "PROD" else + ".eve.WEB3-STAGE" if db == "WEB3-STAGE" else + ".eve.WEB3-PROD" if db == "WEB3-PROD" else + ".eve.STAGE" + ) + eve_path = os.path.join(home_dir, eve_file) if os.path.exists(eve_path): diff --git a/eve/cli/agent_cli.py b/eve/cli/agent_cli.py index 3e8f987..c733fd4 100644 --- a/eve/cli/agent_cli.py +++ b/eve/cli/agent_cli.py @@ -15,7 +15,7 @@ def agent(): @agent.command() @click.option( "--db", - type=click.Choice(["STAGE", "PROD"], case_sensitive=False), + type=click.Choice(["STAGE", "PROD", "WEB3-STAGE", "WEB3-PROD"], case_sensitive=False), default="STAGE", help="DB to save against", ) diff --git a/eve/cli/chat_cli.py b/eve/cli/chat_cli.py index bc5bdb8..55a1a9f 100644 --- a/eve/cli/chat_cli.py +++ b/eve/cli/chat_cli.py @@ -120,7 +120,7 @@ async def async_chat(agent_name, new_thread=True, debug=False): @click.command() @click.option( "--db", - type=click.Choice(["STAGE", "PROD"], case_sensitive=False), + type=click.Choice(["STAGE", "PROD", "WEB3-STAGE", "WEB3-PROD"], case_sensitive=False), default="STAGE", help="DB to save against", ) diff --git a/eve/cli/deploy_cli.py b/eve/cli/deploy_cli.py index 6aec943..5a52204 100644 --- a/eve/cli/deploy_cli.py +++ b/eve/cli/deploy_cli.py @@ -156,7 +156,7 @@ def process_agent(agent_path: Path, env: str): @click.option("--all", is_flag=True, help="Deploy all configured agents") @click.option( "--db", - type=click.Choice(["STAGE", "PROD"], case_sensitive=False), + type=click.Choice(["STAGE", "PROD", "WEB3-STAGE", "WEB3-PROD"], case_sensitive=False), default="STAGE", help="DB to save against", ) @@ -166,8 +166,15 @@ def deploy(agent: str, all: bool, db: str): # Ensure Modal environment exists ensure_modal_env_exists() load_env(db) - env = "stage" if db == "STAGE" else "prod" - + + env_map = { + "STAGE": "stage", + "PROD": "prod", + "WEB3-STAGE": "web3-stage", + "WEB3-PROD": "web3-prod" + } + env = env_map.get(db, "stage") + if all: agents = get_deployable_agents(env) if not agents: diff --git a/eve/cli/start_cli.py b/eve/cli/start_cli.py index ea5739d..efca93e 100644 --- a/eve/cli/start_cli.py +++ b/eve/cli/start_cli.py @@ -16,7 +16,7 @@ @click.argument("agent", nargs=1, required=True) @click.option( "--db", - type=click.Choice(["STAGE", "PROD"], case_sensitive=False), + type=click.Choice(["STAGE", "PROD", "WEB3-STAGE", "WEB3-PROD"], case_sensitive=False), default="STAGE", help="DB to save against", ) @@ -138,7 +138,7 @@ def start(agent: str, db: str, platforms: tuple, local: bool): ) @click.option( "--db", - type=click.Choice(["STAGE", "PROD"], case_sensitive=False), + type=click.Choice(["STAGE", "PROD", "WEB3-STAGE", "WEB3-PROD"], case_sensitive=False), default="STAGE", help="DB to save against", ) diff --git a/eve/cli/tool_cli.py b/eve/cli/tool_cli.py index 83ff733..396d384 100644 --- a/eve/cli/tool_cli.py +++ b/eve/cli/tool_cli.py @@ -65,7 +65,7 @@ def tool(): @tool.command() @click.option( "--db", - type=click.Choice(["STAGE", "PROD"], case_sensitive=False), + type=click.Choice(["STAGE", "PROD", "WEB3-STAGE", "WEB3-PROD"], case_sensitive=False), default="STAGE", help="DB to save against", ) @@ -116,7 +116,7 @@ def update(db: str, names: tuple): @tool.command() @click.option( "--db", - type=click.Choice(["STAGE", "PROD"], case_sensitive=False), + type=click.Choice(["STAGE", "PROD", "WEB3-STAGE", "WEB3-PROD"], case_sensitive=False), default="STAGE", help="DB to save against", ) @@ -155,7 +155,7 @@ def remove(db: str, names: tuple): @tool.command(context_settings=dict(ignore_unknown_options=True, allow_extra_args=True)) @click.option( "--db", - type=click.Choice(["STAGE", "PROD"], case_sensitive=False), + type=click.Choice(["STAGE", "PROD", "WEB3-STAGE", "WEB3-PROD"], case_sensitive=False), default="STAGE", help="DB to load tools from if from mongo", ) @@ -214,7 +214,7 @@ def run(ctx, tool: str, db: str): ) @click.option( "--db", - type=click.Choice(["STAGE", "PROD"], case_sensitive=False), + type=click.Choice(["STAGE", "PROD", "WEB3-STAGE", "WEB3-PROD"], case_sensitive=False), default="STAGE", help="DB to load tools from if from mongo", ) diff --git a/eve/cli/upload_cli.py b/eve/cli/upload_cli.py index b8d3001..cdaeae7 100644 --- a/eve/cli/upload_cli.py +++ b/eve/cli/upload_cli.py @@ -5,7 +5,7 @@ @click.command() @click.option( "--db", - type=click.Choice(["STAGE", "PROD"], case_sensitive=False), + type=click.Choice(["STAGE", "PROD", "WEB3-STAGE", "WEB3-PROD"], case_sensitive=False), default="STAGE", help="DB to save against", ) diff --git a/eve/clients/common.py b/eve/clients/common.py index ac72f32..d443b09 100644 --- a/eve/clients/common.py +++ b/eve/clients/common.py @@ -107,5 +107,15 @@ def get_ably_channel_name(agent_username: str, client_platform: ClientType): def get_eden_creation_url(creation_id: str): - root_url = "beta.eden.art" if db == "PROD" else "staging2.app.eden.art" + if db == "PROD": + root_url = "beta.eden.art" + elif db == "STAGE": + root_url = "staging2.app.eden.art" + elif db == "WEB3-PROD": + root_url = "web3.eden.art" + elif db == "WEB3-STAGE": + root_url = "staging.web3.eden.art" + else: + root_url = "staging2.app.eden.art" + return f"https://{root_url}/creations/{creation_id}"