Skip to content
Back to top
View this page

# mindroot package

## Subpackages

- mindroot.lib package
  - Subpackages
    - mindroot.lib.auth package
      - Submodules
      - mindroot.lib.auth.api_key module
      - mindroot.lib.auth.auth module
      - Module contents
    - mindroot.lib.json_str_block package
      - Submodules
      - mindroot.lib.json_str_block.json_str_block module
      - Module contents
    - mindroot.lib.plugins package
      - Submodules
      - mindroot.lib.plugins.installation module
      - mindroot.lib.plugins.l8n_static_handler module
      - mindroot.lib.plugins.loader module
      - mindroot.lib.plugins.loader_with_l8n module
      - mindroot.lib.plugins.manifest module
      - mindroot.lib.plugins.mapping module
      - mindroot.lib.plugins.paths module
      - Module contents
    - mindroot.lib.providers package
      - Subpackages
      - Submodules
      - mindroot.lib.providers.commands module
      - mindroot.lib.providers.hooks module
      - mindroot.lib.providers.missing module
      - mindroot.lib.providers.model_preferences_v2 module
      - mindroot.lib.providers.services module
      - Module contents
  - Submodules
  - mindroot.lib.buchatlog module
  - mindroot.lib.buchatlog2 module
  - mindroot.lib.butemplates module
  - mindroot.lib.chatcontext module
    - `BaseCommandSet`
    - `BaseService`
    - `ChatContext`
      - `ChatContext.cmds()`
      - `ChatContext.delete()`
      - `ChatContext.delete_session_by_id()`
      - `ChatContext.load_context()`
      - `ChatContext.proto()`
      - `ChatContext.save_context()`
      - `ChatContext.save_context_data()`
    - `get_context()`
  - mindroot.lib.chatlog module
    - `ChatLog`
      - `ChatLog.add_message()`
      - `ChatLog.add_message_async()`
      - `ChatLog.add_message_role()`
      - `ChatLog.count_tokens()`
      - `ChatLog.drop_last()`
      - `ChatLog.get_history()`
      - `ChatLog.get_recent()`
      - `ChatLog.load_log()`
      - `ChatLog.parsed_commands()`
      - `ChatLog.save_log()`
    - `build_token_hierarchy()`
    - `count_tokens_for_log_id()`
    - `extract_delegate_task_log_ids()`
    - `find_chatlog_file()`
    - `find_child_logs_by_parent_id()`
    - `get_cache_dir()`
    - `get_cache_path()`
    - `get_cached_token_counts()`
    - `save_token_counts_to_cache()`
  - mindroot.lib.chatlog_optimized module
  - mindroot.lib.json_escape module
    - `escape_for_json()`
  - mindroot.lib.model_selector module
  - mindroot.lib.parent_templates module
    - `FirstMatchLoader`
      - `FirstMatchLoader.get_source()`
    - `get_parent_templates_env()`
  - mindroot.lib.plugins module
    - `check_plugin_dependencies()`
    - `get_plugin_import_path()`
    - `get_plugin_path()`
    - `install_plugin_dependencies()`
    - `list_enabled()`
    - `load()`
    - `load_plugin_manifest()`
    - `plugin_install()`
    - `plugin_update()`
    - `pre_load()`
    - `save_plugin_manifest()`
    - `toggle_plugin_state()`
    - `update_plugin_manifest()`
  - mindroot.lib.plugins_install module
    - `install_plugins()`
    - `main()`
    - `update_plugins_json()`
  - mindroot.lib.route_decorators module
    - `add_public_static()`
    - `public_route()`
    - `requires_all_roles()`
    - `requires_any_role()`
    - `requires_role()`
  - mindroot.lib.session_files module
    - `load_session_data()`
    - `save_session_data()`
  - mindroot.lib.streamcmd module
    - `read_stream()`
    - `run_command_with_streaming()`
    - `stream_command_as_events()`
  - mindroot.lib.templates module
    - `apply_translations_to_content()`
    - `check_for_localized_template()`
    - `collect_content()`
    - `find_parent_template()`
    - `find_plugin_template()`
    - `get_current_language()`
    - `load_plugin_templates()`
    - `load_template_with_translation()`
    - `render()`
    - `render_combined_template()`
    - `render_direct_template()`
    - `setup_template_environment()`
  - mindroot.lib.token_counter module
    - `count_tokens_for_log_id()`
    - `extract_delegate_task_log_ids()`
    - `find_chatlog_file()`
    - `get_cache_dir()`
    - `get_cache_path()`
    - `get_cached_token_counts()`
    - `save_token_counts_to_cache()`
  - Module contents
- mindroot.registry package
  - Submodules
  - mindroot.registry.component_manager module
    - `ComponentManager`
      - `ComponentManager.get_component_metadata()`
      - `ComponentManager.is_component_activated()`
      - `ComponentManager.is_component_installed()`
      - `ComponentManager.list_components()`
      - `ComponentManager.register_component()`
  - mindroot.registry.data_access module
    - `DataAccess`
      - `DataAccess.add_plugin()`
      - `DataAccess.add_provider()`
      - `DataAccess.get_model()`
      - `DataAccess.get_provider()`
      - `DataAccess.read_equivalent_flags()`
      - `DataAccess.read_json()`
      - `DataAccess.read_models()`
      - `DataAccess.read_plugins()`
      - `DataAccess.read_preferred_models()`
      - `DataAccess.read_providers()`
      - `DataAccess.remove_plugin()`
      - `DataAccess.remove_provider()`
      - `DataAccess.update_model()`
      - `DataAccess.update_plugin()`
      - `DataAccess.update_provider()`
      - `DataAccess.write_equivalent_flags()`
      - `DataAccess.write_json()`
      - `DataAccess.write_models()`
      - `DataAccess.write_plugins()`
      - `DataAccess.write_preferred_models()`
      - `DataAccess.write_providers()`
  - Module contents

## Submodules

## mindroot.migrate module

mindroot.migrate.migrate_plugin_manifest()

  Migrate plugin_manifest.json from root to data/ directory if needed.

  This function now delegates to the consolidated manifest handling logic.

mindroot.migrate.run_migrations()

  Run all necessary migrations.

## mindroot.server module

class mindroot.server.HeaderMiddleware(app: Callable[[MutableMapping[str, Any], Callable[[], Awaitable[MutableMapping[str, Any]]], Callable[[MutableMapping[str, Any]], Awaitable[None]]], Awaitable[None]], dispatch: Callable[[Request, Callable[[Request], Awaitable[Response]]], Awaitable[Response]] | None = None)

  Bases: `BaseHTTPMiddleware`

  async dispatch(request: Request, call_next)

class mindroot.server.PyInstrumentMiddleware(app: Callable[[MutableMapping[str, Any], Callable[[], Awaitable[MutableMapping[str, Any]]], Callable[[MutableMapping[str, Any]], Awaitable[None]]], Awaitable[None]], dispatch: Callable[[Request, Callable[[Request], Awaitable[Response]]], Awaitable[Response]] | None = None)

  Bases: `BaseHTTPMiddleware`

  async dispatch(request: Request, call_next)

mindroot.server.create_directories()

mindroot.server.find_available_port(start_port=8010, max_attempts=100)

mindroot.server.get_project_root()

mindroot.server.is_port_in_use(port)

mindroot.server.main()

mindroot.server.parse_args()

async mindroot.server.setup_app_internal(app_)

## mindroot.server_missing_normal_args module

class mindroot.server_missing_normal_args.HeaderMiddleware(app: Callable[[MutableMapping[str, Any], Callable[[], Awaitable[MutableMapping[str, Any]]], Callable[[MutableMapping[str, Any]], Awaitable[None]]], Awaitable[None]], dispatch: Callable[[Request, Callable[[Request], Awaitable[Response]]], Awaitable[Response]] | None = None)

  Bases: `BaseHTTPMiddleware`

  async dispatch(request: Request, call_next)

mindroot.server_missing_normal_args.create_directories()

mindroot.server_missing_normal_args.find_available_port(start_port=8010, max_attempts=100)

mindroot.server_missing_normal_args.get_project_root()

mindroot.server_missing_normal_args.is_port_in_use(port)

mindroot.server_missing_normal_args.main()

mindroot.server_missing_normal_args.parse_args()

async mindroot.server_missing_normal_args.setup_app_internal(app_)

## mindroot.server_prev module

class mindroot.server_prev.HeaderMiddleware(app: Callable[[MutableMapping[str, Any], Callable[[], Awaitable[MutableMapping[str, Any]]], Callable[[MutableMapping[str, Any]], Awaitable[None]]], Awaitable[None]], dispatch: Callable[[Request, Callable[[Request], Awaitable[Response]]], Awaitable[Response]] | None = None)

  Bases: `BaseHTTPMiddleware`

  async dispatch(request: Request, call_next)

mindroot.server_prev.create_directories()

mindroot.server_prev.find_available_port(start_port=8010, max_attempts=100)

mindroot.server_prev.get_project_root()

mindroot.server_prev.is_port_in_use(port)

mindroot.server_prev.main()

mindroot.server_prev.parse_args()

async mindroot.server_prev.setup_app_internal(app_)

## Module contents

MindRoot - AI Agent Framework

Convenience imports for common functionality:

> from mindroot.services import service, service_class, service_manager from mindroot.protocols import LLM, Image, TTS, llm, image, tts