diff --git a/pyproject.toml b/pyproject.toml index f6de0e4..b878864 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -181,7 +181,6 @@ ignore = [ "A002", # Argument shadows built-in "A004", # Import shadows built-in "FBT001", # Boolean positional arg - "FBT002", # Boolean default value "N801", # Class name casing "N802", # Function name casing "N806", # Variable casing diff --git a/src/seclab_taskflow_agent/agent.py b/src/seclab_taskflow_agent/agent.py index a26222a..02b7921 100644 --- a/src/seclab_taskflow_agent/agent.py +++ b/src/seclab_taskflow_agent/agent.py @@ -150,6 +150,7 @@ def __init__( name: str = "TaskAgent", instructions: str = "", handoffs: list[Any] | None = None, + *, exclude_from_context: bool = False, mcp_servers: list[Any] | None = None, model: str = DEFAULT_MODEL, diff --git a/src/seclab_taskflow_agent/cli.py b/src/seclab_taskflow_agent/cli.py index 7569431..2a994e2 100644 --- a/src/seclab_taskflow_agent/cli.py +++ b/src/seclab_taskflow_agent/cli.py @@ -87,6 +87,7 @@ def main( str | None, typer.Option("-t", "--taskflow", help="Taskflow module path (mutually exclusive with -p)."), ] = None, + *, list_models: Annotated[ bool, typer.Option("-l", "--list-models", help="List available tool-call models and exit."), diff --git a/src/seclab_taskflow_agent/mcp_lifecycle.py b/src/seclab_taskflow_agent/mcp_lifecycle.py index 117f52a..f2f3ac9 100644 --- a/src/seclab_taskflow_agent/mcp_lifecycle.py +++ b/src/seclab_taskflow_agent/mcp_lifecycle.py @@ -45,6 +45,7 @@ def build_mcp_servers( available_tools: AvailableTools, toolboxes: list[str], blocked_tools: list[str] | None = None, + *, headless: bool = False, ) -> list[MCPServerEntry]: """Build MCP server instances for the given toolboxes. diff --git a/src/seclab_taskflow_agent/mcp_servers/codeql/client.py b/src/seclab_taskflow_agent/mcp_servers/codeql/client.py index af7d03d..dc73b77 100644 --- a/src/seclab_taskflow_agent/mcp_servers/codeql/client.py +++ b/src/seclab_taskflow_agent/mcp_servers/codeql/client.py @@ -44,6 +44,7 @@ def __init__( self, codeql_cli=os.getenv("CODEQL_CLI", default="codeql"), server_options=["--threads=0", "--quiet"], + *, log_stderr=False, ): self.server_options = server_options.copy() @@ -406,7 +407,7 @@ def _bqrs_to_sarif(self, bqrs_path, query_info, max_paths=10): class QueryServer(CodeQL): - def __init__(self, database: Path, keep_alive=False, log_stderr=False): + def __init__(self, database: Path, *, keep_alive=False, log_stderr=False): super().__init__(log_stderr=log_stderr) self.database = database self.keep_alive = keep_alive @@ -476,7 +477,7 @@ def _file_uri_to_path(uri): return path, region -def _get_source_prefix(database_path: Path, strip_leading_slash=True) -> str: +def _get_source_prefix(database_path: Path, *, strip_leading_slash=True) -> str: # grab the source prefix from codeql-database.yml db_yml_path = Path(database_path) / Path("codeql-database.yml") with open(db_yml_path) as stream: @@ -491,7 +492,7 @@ def _get_source_prefix(database_path: Path, strip_leading_slash=True) -> str: raise -def list_src_files(database_path: str | Path, as_uri=False, strip_prefix=True): +def list_src_files(database_path: str | Path, *, as_uri=False, strip_prefix=True): src_path = Path(database_path) / Path("src.zip") files = shell_command_to_string(["zipinfo", "-1", src_path]).split("\n") source_prefix = _get_source_prefix(Path(database_path)) @@ -503,7 +504,7 @@ def list_src_files(database_path: str | Path, as_uri=False, strip_prefix=True): return files -def search_in_src_archive(database_path: str, search_term: str, as_uri=False, strip_prefix=True): +def search_in_src_archive(database_path: str, search_term: str, *, as_uri=False, strip_prefix=True): database_path = Path(database_path) src_path = database_path / Path("src.zip") results = {} @@ -595,6 +596,7 @@ def run_query( target="", progress_callback=None, template_values=None, + *, # keep the query server alive if desired keep_alive=True, log_stderr=False, diff --git a/src/seclab_taskflow_agent/mcp_servers/codeql/jsonrpyc/__init__.py b/src/seclab_taskflow_agent/mcp_servers/codeql/jsonrpyc/__init__.py index 8d14d96..07a710d 100644 --- a/src/seclab_taskflow_agent/mcp_servers/codeql/jsonrpyc/__init__.py +++ b/src/seclab_taskflow_agent/mcp_servers/codeql/jsonrpyc/__init__.py @@ -664,6 +664,7 @@ def __init__( rpc: RPC, name: str = "watchdog", interval: float = 0.1, + *, daemon: bool = False, start: bool = True, ) -> None: diff --git a/src/seclab_taskflow_agent/render_utils.py b/src/seclab_taskflow_agent/render_utils.py index 7a01850..9539ecb 100644 --- a/src/seclab_taskflow_agent/render_utils.py +++ b/src/seclab_taskflow_agent/render_utils.py @@ -31,7 +31,7 @@ async def flush_async_output(task_id: str) -> None: await render_model_output(data) -async def render_model_output(data: str, log: bool = True, async_task: bool = False, task_id: str | None = None) -> None: +async def render_model_output(data: str, *, log: bool = True, async_task: bool = False, task_id: str | None = None) -> None: """Print model output to the console, optionally buffering for async tasks.""" async with async_output_lock: if async_task and task_id: diff --git a/src/seclab_taskflow_agent/runner.py b/src/seclab_taskflow_agent/runner.py index 5869385..d5b92b2 100644 --- a/src/seclab_taskflow_agent/runner.py +++ b/src/seclab_taskflow_agent/runner.py @@ -309,7 +309,7 @@ async def deploy_task_agents( model_settings = ModelSettings(**model_params) # Build MCP servers and collect server prompts - entries = build_mcp_servers(available_tools, toolboxes, blocked_tools, headless) + entries = build_mcp_servers(available_tools, toolboxes, blocked_tools, headless=headless) mcp_params = mcp_client_params(available_tools, toolboxes) server_prompts = [sp for _, (_, _, sp, _) in mcp_params.items()] @@ -585,7 +585,7 @@ async def on_handoff_hook(context: RunContextWrapper[TContext], agent: Agent[TCo available_tools, global_variables, inputs, ) - async def run_prompts(async_task: bool = False, max_concurrent_tasks: int = 5) -> bool: + async def run_prompts(*, async_task: bool = False, max_concurrent_tasks: int = 5) -> bool: if run: await render_model_output("** 🤖🐚 Executing Shell Task\n") try: diff --git a/src/seclab_taskflow_agent/template_utils.py b/src/seclab_taskflow_agent/template_utils.py index 2f21d4a..1508ea8 100644 --- a/src/seclab_taskflow_agent/template_utils.py +++ b/src/seclab_taskflow_agent/template_utils.py @@ -56,7 +56,7 @@ def get_source( raise jinja2.TemplateNotFound(template) -def env_function(var_name: str, default: Optional[str] = None, required: bool = True) -> str: +def env_function(var_name: str, default: Optional[str] = None, *, required: bool = True) -> str: """Jinja2 function to access environment variables. Args: