Skip to main content

AgentDebugApi API

Agent Debug API

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

Quick Reference

MethodDescription
cleanupCleans up old agent debug data.
getBySwarmRetrieves agent instances associated with a specific swarm.
getByThreadRetrieves agent instances associated with a specific thread.
getFilteredInstancesRetrieves agent instances matching specific filter criteria.
getInstanceRetrieves details for a specific agent debug instance.
getInstanceLogsRetrieves parsed and structured logs for a specific agent instance.
getInstanceRawLogsRetrieves raw, unprocessed logs for a specific agent instance.
getInstancesRetrieves all agent debug instances.
getRunningRetrieves all currently running agent instances.
rebuildIndexRebuilds the agent debug index.

Methods


cleanup

client.agentDebugApi.cleanup(params?: CleanupAgentDebugParams): Promise<unknown>

Cleans up old agent debug data.

Removes debug records that are older than the specified threshold. Use this to free up storage and keep the debug system performant.

ParameterTypeRequiredDescription
paramsCleanupAgentDebugParamsNoQuery parameters controlling the cleanup

Returns: Promise<unknown> — A promise that resolves when cleanup is complete

Full reference →


getBySwarm

client.agentDebugApi.getBySwarm(swarmId: string): Promise<AgentDebugInstance[]>

Retrieves agent instances associated with a specific swarm.

Returns all debug instances that belong to the given swarm, useful for inspecting multi-agent coordination.

ParameterTypeRequiredDescription
swarmIdstringYesThe unique identifier of the swarm to query

Returns: Promise<AgentDebugInstance[]> — A promise that resolves to an array of AgentDebugInstance objects for that swarm

Full reference →


getByThread

client.agentDebugApi.getByThread(threadId: string): Promise<AgentDebugInstance[]>

Retrieves agent instances associated with a specific thread.

Returns all debug instances that were spawned within or are linked to the given thread ID.

ParameterTypeRequiredDescription
threadIdstringYesThe unique identifier of the thread to query

Returns: Promise<AgentDebugInstance[]> — A promise that resolves to an array of AgentDebugInstance objects for that thread

Full reference →


getFilteredInstances

client.agentDebugApi.getFilteredInstances(params?: AgentDebugFilterParams): Promise<AgentDebugInstance[]>

Retrieves agent instances matching specific filter criteria.

Supports filtering by status, agent type, thread ID, swarm ID, and whether the agent is running in the background.

ParameterTypeRequiredDescription
paramsAgentDebugFilterParamsNoFilter parameters to narrow down results

Returns: Promise<AgentDebugInstance[]> — A promise that resolves to an array of matching AgentDebugInstance objects

Full reference →


getInstance

client.agentDebugApi.getInstance(agentInstanceId: string): Promise<AgentDebugInstance>

Retrieves details for a specific agent debug instance.

Returns the full debug record for a single agent instance including its configuration, status, timing, and metadata.

ParameterTypeRequiredDescription
agentInstanceIdstringYesThe unique identifier of the agent instance

Returns: Promise<AgentDebugInstance> — A promise that resolves to the AgentDebugInstance object

Full reference →


getInstanceLogs

client.agentDebugApi.getInstanceLogs(agentInstanceId: string, params?: AgentDebugLogsParams): Promise<AgentDebugLog[]>

Retrieves parsed and structured logs for a specific agent instance.

Returns logs that have been parsed into structured AgentDebugLog objects, making them easier to analyze programmatically. Supports pagination through offset and limit parameters.

ParameterTypeRequiredDescription
agentInstanceIdstringYesThe unique identifier of the agent instance
paramsAgentDebugLogsParamsNoOptional pagination parameters

Returns: Promise<AgentDebugLog[]> — A promise that resolves to an array of structured AgentDebugLog objects

Full reference →


getInstanceRawLogs

client.agentDebugApi.getInstanceRawLogs(agentInstanceId: string, params?: AgentDebugLogsParams): Promise<unknown>

Retrieves raw, unprocessed logs for a specific agent instance.

Returns the raw log output as produced by the agent, without any parsing or structuring. Useful for debugging issues not captured by the structured log parser.

ParameterTypeRequiredDescription
agentInstanceIdstringYesThe unique identifier of the agent instance
paramsAgentDebugLogsParamsNoOptional pagination parameters

Returns: Promise<unknown> — A promise that resolves to the raw log data

Full reference →


getInstances

client.agentDebugApi.getInstances(params?: Record<string, unknown>): Promise<AgentDebugInstance[]>

Retrieves all agent debug instances.

Returns every agent instance that has been tracked by the debug system, regardless of its current status.

ParameterTypeRequiredDescription
paramsRecord<string, unknown>NoOptional query parameters for filtering or pagination

Returns: Promise<AgentDebugInstance[]> — A promise that resolves to an array of AgentDebugInstance objects

Full reference →


getRunning

client.agentDebugApi.getRunning(): Promise<AgentDebugInstance[]>

Retrieves all currently running agent instances.

A convenience method that returns only instances with an active/running status, useful for real-time monitoring dashboards.

No parameters.

Returns: Promise<AgentDebugInstance[]> — A promise that resolves to an array of running AgentDebugInstance objects

Full reference →


rebuildIndex

client.agentDebugApi.rebuildIndex(data?: RebuildAgentDebugIndexRequest): Promise<unknown>

Rebuilds the agent debug index.

Forces a full re-index of all agent debug data. This can resolve issues with missing or inconsistent search results in the debug interface.

ParameterTypeRequiredDescription
dataRebuildAgentDebugIndexRequestNoOptional configuration for the rebuild operation

Returns: Promise<unknown> — A promise that resolves when the index rebuild is complete

Full reference →