Files
EvoScientist-Multi/EvoScientist/cli/_app.py
T
Xi Zhang fb329e4aaa perf: cut startup latency — lazy import surface, langgraph dev keepalive, indexed thread listing (#407)
* feat: add thread metadata index for improved performance in thread listing

- Implemented a new SQLite index on the `checkpoints` table to optimize thread listing queries by indexing relevant metadata fields.
- Updated the `list_threads` function to ensure the index is created if it does not exist.
- Added a test to verify the creation of the metadata index during thread listing.

feat: enhance workspace sidecar management with owner tracking

- Modified the workspace sidecar to include `owner_pids` to track the current process owners.
- Updated tests to validate the new owner tracking functionality and ensure proper behavior when managing workspace sidecars.

chore: introduce model registry for streamlined model management

- Created a new `registry.py` file to maintain a comprehensive model registry, including model names, IDs, providers, and routing tables.
- Added functions to retrieve models by provider and list available models, enhancing the modularity and maintainability of model management.

* feat: enhance workspace sidecar management and improve thread metadata indexing

* fix(tests): ensure sidecar correctly registers owner with original workspace and pid

* refactor: simplify workspace sidecar management by removing owner tracking

* feat(server): add commands to manage background langgraph dev server

- Introduced `server_app` for managing the langgraph dev server with commands to check status and stop the server.
- Enhanced workspace sidecar management to include configuration fingerprint for drift detection.
- Updated deployment functions to handle server configuration and state more effectively.

* feat(server): enhance server status command to display PID with stale record warning

* feat(langgraph_dev): exclusion-set config fingerprint, webui keepalive, unified stop guidance

* fix(cli): platform-specific manual-stop hint; document keepalive endpoint-change limitation
2026-08-11 08:37:58 +01:00

76 lines
2.7 KiB
Python

"""Typer application objects — no intra-package imports to avoid circular deps."""
import typer # type: ignore[import-untyped]
app = typer.Typer(
no_args_is_help=False,
add_completion=False,
context_settings={"help_option_names": ["-h", "--help"]},
)
# Config subcommand group
config_app = typer.Typer(
help="Configuration management commands", invoke_without_command=True
)
app.add_typer(config_app, name="config")
# MCP subcommand group
_MCP_HELP = """\
Configure and manage MCP servers
Examples:
# Add a local MCP server (stdio auto-detected):
EvoSci mcp add local-server python -- /path/to/server.py
# Add an npx-based server:
EvoSci mcp add sequential-thinking npx -- -y @modelcontextprotocol/server-sequential-thinking
# Add an HTTP server (http auto-detected from URL):
EvoSci mcp add docs-langchain https://docs.langchain.com/mcp
# Add a stdio server with env vars (hardcoded):
EvoSci mcp add my-server node --env API_KEY=xxx -- server.js
# Add a server with runtime env ref (resolved from .env at startup):
EvoSci mcp add brave-search npx --env-ref BRAVE_API_KEY -- -y @modelcontextprotocol/server-brave-search
# Expose to a specific sub-agent (e.g. research-agent):
EvoSci mcp add brave-search npx --env-ref BRAVE_API_KEY -e research-agent -- -y @modelcontextprotocol/server-brave-search
# Expose to multiple agents:
EvoSci mcp add local-server python -e main,research-agent,code-agent -- /path/to/server.py
# Explicit transport override:
EvoSci mcp add my-sse https://example.com/sse --transport sse
Sub-agents (-e): planner-agent | research-agent | code-agent | debug-agent | data-analysis-agent | writing-agent
"""
mcp_app = typer.Typer(help=_MCP_HELP, invoke_without_command=True)
app.add_typer(mcp_app, name="mcp")
# Channel subcommand group
channel_app = typer.Typer(help="Channel management commands")
app.add_typer(channel_app, name="channel")
# Sessions subcommand group — diagnostic tools for the LangGraph checkpoint DB
sessions_app = typer.Typer(
help="Inspect and manage the sessions DB (~/.evoscientist/sessions.db)",
invoke_without_command=True,
)
app.add_typer(sessions_app, name="sessions")
# Background langgraph dev server management — the explicit counterpart to
# langgraph_dev_keepalive: a server that outlives its CLI needs a first-class
# way to inspect and stop it.
server_app = typer.Typer(help="Manage the background langgraph dev server")
app.add_typer(server_app, name="server")
# Configure subcommand group — re-run a single onboarding section.
configure_app = typer.Typer(
help=(
"Re-run one onboarding section without going through the full wizard.\n"
"Example: EvoSci configure provider"
),
)
app.add_typer(configure_app, name="configure")