TypeScript Types
Complete TypeScript type definitions for AxCrew
This page documents all the TypeScript types and interfaces exported by AxCrew.
The configuration object for an AxCrew instance.
interface AxCrewConfig {
crew: AgentConfig[]
}
Configuration for an individual agent in the crew.
interface AgentConfig {
name: string;
description: string;
signature: string | AxSignature;
provider: Provider;
providerKeyName?: string;
ai: AxModelConfig & { model: string };
// Optional fields
definition?: string; // Agent persona (min 100 chars)
prompt?: string; // Alias for definition
debug?: boolean;
apiURL?: string;
providerArgs?: Record<string, unknown>;
options?: Partial<AxProgramForwardOptions<any>> & Record<string, any>;
functions?: string[];
agents?: string[];
examples?: Array<Record<string, any>>;
mcpServers?: Record<string, MCPTransportConfig>;
ace?: ACEConfig;
}
Options for the AxCrew constructor.
interface AxCrewOptions {
debug?: boolean;
telemetry?: {
tracer?: any; // OpenTelemetry Tracer
meter?: any; // OpenTelemetry Meter
}
}
Interface for the state object that agents can access.
interface StateInstance {
reset(): void;
set(key: string, value: any): void;
get(key: string): any;
getAll(): Record<string, any>;
[key: string]: any;
}
A registry of functions that can be used by agents.
type FunctionRegistryType = {
[key: string]: AxFunction | {
new(state: Record<string, any>): {
toFunction: () => AxFunction
}
};
};
Config for an STDIO MCP server.
interface MCPStdioTransportConfig {
command: string;
args?: string[];
env?: NodeJS.ProcessEnv;
}
Config for an HTTP SSE MCP server.
interface MCPHTTPSSETransportConfig {
sseUrl: string;
}
Config for a streamable HTTP MCP server.
interface MCPStreamableHTTPTransportConfig {
mcpEndpoint: string;
options?: AxMCPStreamableHTTPTransportOptions;
}
Union type for all MCP transport configurations.
type MCPTransportConfig =
| MCPStdioTransportConfig
| MCPHTTPSSETransportConfig
| MCPStreamableHTTPTransportConfig;
Cost information for an individual agent call.
interface UsageCost {
promptCost: string;
completionCost: string;
totalCost: string;
tokenMetrics: {
promptTokens: number;
completionTokens: number;
totalTokens: number;
};
}
Aggregated cost information for all agents in the crew.
interface AggregatedCosts {
totalCost: string;
byAgent: Record<string, UsageCost>;
aggregatedMetrics: AggregatedMetrics;
}
Aggregated metrics from all agent invocations.
interface AggregatedMetrics {
promptTokens: number;
completionTokens: number;
totalTokens: number;
promptCost: string;
completionCost: string;
}
Configuration for ACE (Agentic Context Engineering).
interface ACEConfig {
teacher?: ACETeacherConfig;
persistence?: ACEPersistenceConfig;
options?: ACEOptionsConfig;
metric?: ACEMetricConfig;
compileOnStart?: boolean;
}
Teacher model configuration for ACE.
interface ACETeacherConfig {
provider?: Provider;
providerKeyName?: string;
apiURL?: string;
ai?: AxModelConfig & { model: string };
providerArgs?: Record<string, unknown>;
}
Playbook persistence configuration.
interface ACEPersistenceConfig {
playbookPath?: string;
initialPlaybook?: Record<string, any>;
autoPersist?: boolean;
onPersist?: (pb: any) => Promise<void> | void;
onLoad?: () => Promise<any> | any;
}
ACE options configuration.
interface ACEOptionsConfig {
maxEpochs?: number;
allowDynamicSections?: boolean;
tokenBudget?: number;
reflectorPrompt?: string;
curatorPrompt?: string;
}
ACE metric configuration.
interface ACEMetricConfig {
metricFnName?: string;
primaryOutputField?: string;
}
Supported AI providers.
type Provider =
| 'openai'
| 'anthropic'
| 'google-gemini'
| 'cohere'
| 'groq'
| 'together'
| 'mistral'
| 'huggingface'
| 'azure-openai'
| 'ollama'
// ... and more
All types can be imported from the main package:
import type {
AxCrewConfig,
AgentConfig,
AxCrewOptions,
StateInstance,
FunctionRegistryType,
MCPTransportConfig,
UsageCost,
AggregatedCosts,
ACEConfig
} from '@amitdeshmukh/ax-crew';