qbraid_core.services.agents

Module providing client and utilities for the qBraid Agents service.

Classes

AgentsClient([api_key, session])

Client for interacting with the qBraid Agents service.

AgentSessionRegistryManager([registry_path])

Manages the local agent session registry at ~/.qbraid/sessions.json.

Schemas

AgentSession(**data)

Full agent session model.

AgentSessionSummary(**data)

Lightweight session projection for list views.

AgentTask(**data)

A task tracked by an agent (e.g. Claude task list).

TranscriptEntry(**data)

A single parsed transcript event.

GitInfo(**data)

Git repository metadata for a session's working directory.

MCPServerInfo(**data)

MCP server connection info.

SessionRegistry(**data)

Root model for the sessions.json file.

AgentTool(*values)

Supported AI coding tool identifiers.

AgentStatus(*values)

Agent session status.

Functions

detect_sessions([enrich_all])

Discover agent sessions by scanning CLI tool files.

detect_agent_status(tool_id[, details])

Detect the status of an AI agent session from file-based signals.

install_all_hooks()

Install hooks for all supported CLI tools.

uninstall_all_hooks()

Remove qBraid hooks from all supported CLI tools.

parse_transcript(format_name, source[, ...])

Parse a transcript file using the registered parser.

register_parser(format_name)

Decorator to register a transcript parser.

Exceptions

AgentServiceError([message])

Base exception for agent service errors.

AgentServiceRequestError([message])

Exception raised when an agent service API request fails.

AgentSessionNotFoundError([message])

Exception raised when a session is not found.

AgentRegistryError([message])

Exception raised for registry read/write failures.

AgentDiscoveryError([message])

Exception raised when process discovery fails.

AgentTranscriptError([message])

Exception raised when transcript parsing fails.

AgentHookError([message])

Exception raised when hook installation fails.