Skip to main content

Module common

Module common 

Source
Expand description

Common utilities for agent tools

This module provides shared functionality used across multiple tools:

  • Schema generation for OpenAI-compatible tool definitions
  • Error type macros
  • Repository initialization helpers

Macros§

define_tool_error
Macro to define a tool error type with standard From implementations.

Functions§

current_repo_root
Get the repo root bound to the current task, falling back to the current directory.
get_current_repo
Get the current repository from the working directory. This is a common operation used by most tools.
parameters_schema
Generate a JSON schema for tool parameters that’s OpenAI-compatible. OpenAI tool schemas require the required array to list every property.
with_active_repo_root
Run an async operation with a repo root bound to the current task.