agents
Classes
AgenticAdapter
Defined in: packages/nexus-agents/src/agents/agentic/agentic-adapter.ts:97
Agents exports - Agent framework, Orchestrator, Experts Split from index.ts for file size compliance (Issue #285)
Implements
Constructors
Constructor
new AgenticAdapter(modelAdapter, options?): AgenticAdapter;
Defined in: packages/nexus-agents/src/agents/agentic/agentic-adapter.ts:120
Parameters
modelAdapter
options?
Returns
Properties
adapterStrategy
adapterStrategy: string;
Defined in: packages/nexus-agents/src/agents/agentic/agentic-adapter.ts:110
Adapter strategy stamp — composed from the resolved model
identity, NOT the IModelAdapter’s providerId. For a custom OpenAI
gateway fronting Claude, this reads native:anthropic even though
IModelAdapter.providerId === 'openai'.
Initialised eagerly from the modelId parse (sync); upgraded after
the first runAgent if the probe contributes a higher-confidence
vendor signal.
Implementation of
IAgenticAdapter.adapterStrategy
modelId
readonly modelId: string;
Defined in: packages/nexus-agents/src/agents/agentic/agentic-adapter.ts:99
Implementation of
providerId
readonly providerId: string;
Defined in: packages/nexus-agents/src/agents/agentic/agentic-adapter.ts:98
Implementation of
Methods
getProfile()
getProfile(): ModelEntry;
Defined in: packages/nexus-agents/src/agents/agentic/agentic-adapter.ts:152
Read-only accessor for the resolved profile. Mostly used in tests
- observability surfaces; production callers shouldn’t need this.
Returns
getResolvedIdentity()
getResolvedIdentity(): ResolvedModelIdentity;
Defined in: packages/nexus-agents/src/agents/agentic/agentic-adapter.ts:161
Read-only accessor for the resolved identity. After the first
runAgent call (if a probe ran), this may differ from what the
sync constructor stored — useful for audit logs.
Returns
ResolvedModelIdentity
runAgent()
runAgent(args): Promise<Result<AgentRunResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/agentic/agentic-adapter.ts:228
Parameters
args
Returns
Promise<Result<AgentRunResult, AgentError>>
Implementation of
AgentStateMachine
Defined in: packages/nexus-agents/src/agents/state-machine.ts:42
Agent State Machine.
Manages agent lifecycle states with validation, event callbacks, and error recovery mechanisms.
Constructors
Constructor
new AgentStateMachine(options?): AgentStateMachine;
Defined in: packages/nexus-agents/src/agents/state-machine.ts:53
Parameters
options?
StateMachineOptions = {}
Returns
Accessors
errors
Get Signature
get errors(): number;
Defined in: packages/nexus-agents/src/agents/state-machine.ts:77
Gets the current error count.
Returns
number
state
Get Signature
get state(): AgentState;
Defined in: packages/nexus-agents/src/agents/state-machine.ts:63
Gets the current state.
Returns
transitionHistory
Get Signature
get transitionHistory(): readonly StateTransition[];
Defined in: packages/nexus-agents/src/agents/state-machine.ts:70
Gets the transition history.
Returns
readonly StateTransition[]
Methods
canTransition()
canTransition(event): boolean;
Defined in: packages/nexus-agents/src/agents/state-machine.ts:84
Checks if a transition is valid from the current state.
Parameters
event
Returns
boolean
forceError()
forceError(context?): void;
Defined in: packages/nexus-agents/src/agents/state-machine.ts:146
Forces a transition to the error state. Use for unrecoverable errors that should bypass normal transition rules.
Parameters
context?
Record<string, unknown>
Optional context data about the error
Returns
void
getNextState()
getNextState(event): AgentState | undefined;
Defined in: packages/nexus-agents/src/agents/state-machine.ts:92
Gets the next state for an event, if valid.
Parameters
event
Returns
AgentState | undefined
getValidEvents()
getValidEvents(): StateTransitionEvent[];
Defined in: packages/nexus-agents/src/agents/state-machine.ts:100
Gets all valid events from the current state.
Returns
hasError()
hasError(): boolean;
Defined in: packages/nexus-agents/src/agents/state-machine.ts:250
Checks if the agent is in an error state.
Returns
boolean
isAvailable()
isAvailable(): boolean;
Defined in: packages/nexus-agents/src/agents/state-machine.ts:236
Checks if the agent is in a state where it can accept new tasks.
Returns
boolean
isWorking()
isWorking(): boolean;
Defined in: packages/nexus-agents/src/agents/state-machine.ts:243
Checks if the agent is currently working.
Returns
boolean
onStateChange()
onStateChange(callback): () => void;
Defined in: packages/nexus-agents/src/agents/state-machine.ts:213
Subscribes to state change events.
Parameters
callback
Callback to invoke on state changes
Returns
Unsubscribe function
() => void
onTransitionError()
onTransitionError(callback): () => void;
Defined in: packages/nexus-agents/src/agents/state-machine.ts:226
Subscribes to transition error events.
Parameters
callback
Callback to invoke on transition errors
Returns
Unsubscribe function
() => void
recover()
recover(context?): Result<AgentState, AgentError>;
Defined in: packages/nexus-agents/src/agents/state-machine.ts:161
Attempts recovery from the error state.
Parameters
context?
Record<string, unknown>
Optional context data about the recovery
Returns
Result<AgentState, AgentError>
Result with the new state or an AgentError if recovery failed
reset()
reset(clearHistory?): void;
Defined in: packages/nexus-agents/src/agents/state-machine.ts:199
Resets the state machine to its initial state.
Parameters
clearHistory?
boolean = false
Whether to clear the transition history
Returns
void
resetErrorCount()
resetErrorCount(): void;
Defined in: packages/nexus-agents/src/agents/state-machine.ts:190
Resets the error count. Call after successful task completion.
Returns
void
transition()
transition(event, context?): Result<AgentState, AgentError>;
Defined in: packages/nexus-agents/src/agents/state-machine.ts:112
Attempts a state transition.
Parameters
event
The event triggering the transition
context?
Record<string, unknown>
Optional context data for the transition
Returns
Result<AgentState, AgentError>
Result with the new state or an AgentError
ArchitectureExpert
Defined in: packages/nexus-agents/src/agents/experts/architecture-expert.ts:64
ArchitectureExpert - Expert agent for architecture-related tasks.
Extends
Constructors
Constructor
new ArchitectureExpert(options?): ArchitectureExpert;
Defined in: packages/nexus-agents/src/agents/experts/architecture-expert.ts:67
Parameters
options?
Partial<BaseAgentOptions> & {
expertOptions?: ArchitectureExpertOptions;
} = {}
Returns
Overrides
Properties
adapter
protected adapter: IModelAdapter | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:98
Inherited from
budgetTracker
protected readonly budgetTracker: ITokenBudgetTracker;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:97
Inherited from
capabilities
readonly capabilities: readonly AgentCapability[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:95
Agent capabilities
Inherited from
config
protected config: AgentConfig | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:100
Inherited from
emitMessageEvents
protected readonly emitMessageEvents: boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:107
Inherited from
eventBus
protected readonly eventBus: ICollaborationEventBus;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:106
Inherited from
history
protected history: Message[] = [];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:102
Inherited from
id
readonly id: string;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:93
Unique agent identifier
Inherited from
logger
protected readonly logger: ILogger;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:99
Inherited from
maxTokens
protected readonly maxTokens: number;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:105
Inherited from
role
readonly role: AgentRole;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:94
Agent role
Inherited from
sharedState
protected sharedState: Record<string, unknown> = {};
Defined in: packages/nexus-agents/src/agents/base-agent.ts:101
Inherited from
stateMachine
protected readonly stateMachine: AgentStateMachine;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:96
Inherited from
systemPrompt
protected readonly systemPrompt: string | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:103
Inherited from
temperature
protected readonly temperature: number;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:104
Inherited from
Accessors
state
Get Signature
get state(): AgentState;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:176
Current state
Returns
Current state
Inherited from
Methods
addContextItem()
protected addContextItem(
content,
priority?,
category?
): Promise<void>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:344
Parameters
content
string
priority?
100 | 20 | 60 | 80 | 40
category?
"system" | "task" | "active"
Returns
Promise<void>
Inherited from
addToHistory()
protected addToHistory(message): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:331
Parameters
message
Returns
void
Inherited from
buildPrompt()
protected buildPrompt(task): Message[];
Defined in: packages/nexus-agents/src/agents/experts/architecture-expert.ts:95
Parameters
task
Returns
Message[]
Overrides
cleanup()
cleanup(): Promise<void>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:276
Cleanup agent resources.
Returns
Promise<void>
Inherited from
clearHistory()
protected clearHistory(): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:337
Returns
void
Inherited from
complete()
protected complete(request): Promise<Result<CompletionResponse, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:303
Parameters
request
Returns
Promise<Result<CompletionResponse, AgentError>>
Inherited from
execute()
execute(task, options?): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:218
Execute a task.
Parameters
task
Task to execute
options?
Optional execution options (#3016/#3040).
signal cancels the in-flight model call when the caller’s deadline
wins a race; without it, the SDK keeps running to its own 10-minute
timeout after the caller has already discarded the result.
signal?
AbortSignal
Returns
Promise<Result<TaskResult, AgentError>>
Result with TaskResult or AgentError
Inherited from
executeTask()
protected executeTask(task): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/experts/architecture-expert.ts:77
Parameters
task
Returns
Promise<Result<TaskResult, AgentError>>
Overrides
findResolutionForError()
protected findResolutionForError(errorMessage): ErrorResolution | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:393
Parameters
errorMessage
string
Returns
ErrorResolution | undefined
Inherited from
BaseAgent.findResolutionForError
flushMemory()
flushMemory(): Promise<Result<void, AgentMemoryError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:371
Returns
Promise<Result<void, AgentMemoryError>>
Inherited from
getExpertOptions()
getExpertOptions(): Readonly<ArchitectureExpertOptions>;
Defined in: packages/nexus-agents/src/agents/experts/architecture-expert.ts:111
Returns
Readonly<ArchitectureExpertOptions>
getHistory()
protected getHistory(): Message[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:334
Returns
Message[]
Inherited from
getMemoryState()
getMemoryState(): Readonly<AgentMemoryState> | null;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:364
Returns
Readonly<AgentMemoryState> | null
Inherited from
getPruningMetrics()
getPruningMetrics(): Readonly<ContextPruningMetrics>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:340
Returns
Readonly<ContextPruningMetrics>
Inherited from
getRelevantMemories()
getRelevantMemories(): readonly TypedMemoryEntry<MemoryType>[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:367
Returns
readonly TypedMemoryEntry<MemoryType>[]
Inherited from
getTaskLearnings()
protected getTaskLearnings(taskType): readonly TaskLearning[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:396
Parameters
taskType
string
Returns
readonly TaskLearning[]
Inherited from
handleMessage()
handleMessage(msg): Promise<Result<AgentResponse, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:261
Handle an inter-agent message and return a response.
Delivery semantics (#3222). This is a direct, awaited request/response
call: the caller invokes it and holds the returned promise. It is NOT a
queued or broadcast channel — that is the collaboration event bus
(agents/collaboration/event-bus.ts), a fire-and-forget pub/sub with its
own semantics. For this method specifically:
- Ordering is the caller’s responsibility. Sequential
awaits are handled in call order; concurrent calls carry no cross-message ordering guarantee. - Delivery is exactly the method invocation — there is no automatic
retry or redelivery. A returned
err(...)is the caller’s signal to decide whether to retry; the agent does not re-queue the message. - Errors surface as
Result.err, not as a throw for expected conditions; the caller branches on theResult.
Parameters
msg
Message to handle
Returns
Promise<Result<AgentResponse, AgentError>>
Result with AgentResponse, or AgentError on failure (not retried)
Inherited from
hasCapability()
hasCapability(capability): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:292
Parameters
capability
Returns
boolean
Inherited from
initialize()
initialize(ctx): Promise<Result<void, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:205
Initialize the agent with context.
Parameters
ctx
AgentContext
Agent context
Returns
Promise<Result<void, AgentError>>
Result with void or AgentError
Inherited from
isContextPruningEnabled()
isContextPruningEnabled(): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:358
Returns
boolean
Inherited from
BaseAgent.isContextPruningEnabled
isMemoryEnabled()
isMemoryEnabled(): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:361
Returns
boolean
Inherited from
recordLearning()
protected recordLearning(learning): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:384
Parameters
learning
Omit<TaskLearning, "id" | "learnedAt">
Returns
void
Inherited from
recordPattern()
protected recordPattern(p): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:387
Parameters
p
Omit<ExecutionPattern, "id" | "lastSeen" | "occurrences">
Returns
void
Inherited from
recordResolution()
protected recordResolution(r): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:390
Parameters
r
Omit<ErrorResolution, "resolvedAt">
Returns
void
Inherited from
transformError()
protected transformError(error, taskId): AgentError;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:299
Parameters
error
unknown
taskId
string
Returns
Inherited from
abstract BaseAgent
Defined in: packages/nexus-agents/src/agents/base-agent.ts:92
Abstract base class for all agents. Subclasses must implement executeTask and buildPrompt.
Extended by
SimpleAgentOrchestratorCodeExpertSecurityExpertArchitectureExpertTestingExpertDocumentationExpert
Implements
Constructors
Constructor
new BaseAgent(options): BaseAgent;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:129
Parameters
options
Returns
Properties
adapter
protected adapter: IModelAdapter | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:98
budgetTracker
protected readonly budgetTracker: ITokenBudgetTracker;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:97
capabilities
readonly capabilities: readonly AgentCapability[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:95
Agent capabilities
Implementation of
config
protected config: AgentConfig | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:100
emitMessageEvents
protected readonly emitMessageEvents: boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:107
eventBus
protected readonly eventBus: ICollaborationEventBus;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:106
history
protected history: Message[] = [];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:102
id
readonly id: string;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:93
Unique agent identifier
Implementation of
logger
protected readonly logger: ILogger;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:99
maxTokens
protected readonly maxTokens: number;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:105
role
readonly role: AgentRole;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:94
Agent role
Implementation of
sharedState
protected sharedState: Record<string, unknown> = {};
Defined in: packages/nexus-agents/src/agents/base-agent.ts:101
stateMachine
protected readonly stateMachine: AgentStateMachine;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:96
systemPrompt
protected readonly systemPrompt: string | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:103
temperature
protected readonly temperature: number;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:104
Accessors
state
Get Signature
get state(): AgentState;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:176
Current state
Returns
Current state
Implementation of
Methods
addContextItem()
protected addContextItem(
content,
priority?,
category?
): Promise<void>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:344
Parameters
content
string
priority?
100 | 20 | 60 | 80 | 40
category?
"system" | "task" | "active"
Returns
Promise<void>
addToHistory()
protected addToHistory(message): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:331
Parameters
message
Returns
void
buildPrompt()
abstract protected buildPrompt(task): Message[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:297
Parameters
task
Returns
Message[]
cleanup()
cleanup(): Promise<void>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:276
Cleanup agent resources.
Returns
Promise<void>
Implementation of
clearHistory()
protected clearHistory(): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:337
Returns
void
complete()
protected complete(request): Promise<Result<CompletionResponse, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:303
Parameters
request
Returns
Promise<Result<CompletionResponse, AgentError>>
execute()
execute(task, options?): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:218
Execute a task.
Parameters
task
Task to execute
options?
Optional execution options (#3016/#3040).
signal cancels the in-flight model call when the caller’s deadline
wins a race; without it, the SDK keeps running to its own 10-minute
timeout after the caller has already discarded the result.
signal?
AbortSignal
Returns
Promise<Result<TaskResult, AgentError>>
Result with TaskResult or AgentError
Implementation of
executeTask()
abstract protected executeTask(task): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:296
Parameters
task
Returns
Promise<Result<TaskResult, AgentError>>
findResolutionForError()
protected findResolutionForError(errorMessage): ErrorResolution | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:393
Parameters
errorMessage
string
Returns
ErrorResolution | undefined
flushMemory()
flushMemory(): Promise<Result<void, AgentMemoryError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:371
Returns
Promise<Result<void, AgentMemoryError>>
getHistory()
protected getHistory(): Message[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:334
Returns
Message[]
getMemoryState()
getMemoryState(): Readonly<AgentMemoryState> | null;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:364
Returns
Readonly<AgentMemoryState> | null
getPruningMetrics()
getPruningMetrics(): Readonly<ContextPruningMetrics>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:340
Returns
Readonly<ContextPruningMetrics>
getRelevantMemories()
getRelevantMemories(): readonly TypedMemoryEntry<MemoryType>[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:367
Returns
readonly TypedMemoryEntry<MemoryType>[]
getTaskLearnings()
protected getTaskLearnings(taskType): readonly TaskLearning[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:396
Parameters
taskType
string
Returns
readonly TaskLearning[]
handleMessage()
handleMessage(msg): Promise<Result<AgentResponse, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:261
Handle an inter-agent message and return a response.
Delivery semantics (#3222). This is a direct, awaited request/response
call: the caller invokes it and holds the returned promise. It is NOT a
queued or broadcast channel — that is the collaboration event bus
(agents/collaboration/event-bus.ts), a fire-and-forget pub/sub with its
own semantics. For this method specifically:
- Ordering is the caller’s responsibility. Sequential
awaits are handled in call order; concurrent calls carry no cross-message ordering guarantee. - Delivery is exactly the method invocation — there is no automatic
retry or redelivery. A returned
err(...)is the caller’s signal to decide whether to retry; the agent does not re-queue the message. - Errors surface as
Result.err, not as a throw for expected conditions; the caller branches on theResult.
Parameters
msg
Message to handle
Returns
Promise<Result<AgentResponse, AgentError>>
Result with AgentResponse, or AgentError on failure (not retried)
Implementation of
hasCapability()
hasCapability(capability): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:292
Parameters
capability
Returns
boolean
initialize()
initialize(ctx): Promise<Result<void, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:205
Initialize the agent with context.
Parameters
ctx
AgentContext
Agent context
Returns
Promise<Result<void, AgentError>>
Result with void or AgentError
Implementation of
isContextPruningEnabled()
isContextPruningEnabled(): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:358
Returns
boolean
isMemoryEnabled()
isMemoryEnabled(): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:361
Returns
boolean
recordLearning()
protected recordLearning(learning): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:384
Parameters
learning
Omit<TaskLearning, "id" | "learnedAt">
Returns
void
recordPattern()
protected recordPattern(p): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:387
Parameters
p
Omit<ExecutionPattern, "id" | "lastSeen" | "occurrences">
Returns
void
recordResolution()
protected recordResolution(r): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:390
Parameters
r
Omit<ErrorResolution, "resolvedAt">
Returns
void
transformError()
protected transformError(error, taskId): AgentError;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:299
Parameters
error
unknown
taskId
string
Returns
CodeExpert
Defined in: packages/nexus-agents/src/agents/experts/code-expert.ts:40
CodeExpert - Expert agent for code-related tasks.
Specialized in:
- Code generation from specifications
- Code refactoring and cleanup
- Performance optimization
- Bug detection and debugging
Extends
Constructors
Constructor
new CodeExpert(options?): CodeExpert;
Defined in: packages/nexus-agents/src/agents/experts/code-expert.ts:43
Parameters
options?
Partial<BaseAgentOptions> & {
expertOptions?: CodeExpertOptions;
} = {}
Returns
Overrides
Properties
adapter
protected adapter: IModelAdapter | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:98
Inherited from
budgetTracker
protected readonly budgetTracker: ITokenBudgetTracker;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:97
Inherited from
capabilities
readonly capabilities: readonly AgentCapability[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:95
Agent capabilities
Inherited from
config
protected config: AgentConfig | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:100
Inherited from
emitMessageEvents
protected readonly emitMessageEvents: boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:107
Inherited from
eventBus
protected readonly eventBus: ICollaborationEventBus;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:106
Inherited from
history
protected history: Message[] = [];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:102
Inherited from
id
readonly id: string;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:93
Unique agent identifier
Inherited from
logger
protected readonly logger: ILogger;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:99
Inherited from
maxTokens
protected readonly maxTokens: number;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:105
Inherited from
role
readonly role: AgentRole;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:94
Agent role
Inherited from
sharedState
protected sharedState: Record<string, unknown> = {};
Defined in: packages/nexus-agents/src/agents/base-agent.ts:101
Inherited from
stateMachine
protected readonly stateMachine: AgentStateMachine;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:96
Inherited from
systemPrompt
protected readonly systemPrompt: string | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:103
Inherited from
temperature
protected readonly temperature: number;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:104
Inherited from
Accessors
state
Get Signature
get state(): AgentState;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:176
Current state
Returns
Current state
Inherited from
Methods
addContextItem()
protected addContextItem(
content,
priority?,
category?
): Promise<void>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:344
Parameters
content
string
priority?
100 | 20 | 60 | 80 | 40
category?
"system" | "task" | "active"
Returns
Promise<void>
Inherited from
addToHistory()
protected addToHistory(message): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:331
Parameters
message
Returns
void
Inherited from
buildPrompt()
protected buildPrompt(task): Message[];
Defined in: packages/nexus-agents/src/agents/experts/code-expert.ts:76
Build prompt messages for the task.
Parameters
task
Returns
Message[]
Overrides
cleanup()
cleanup(): Promise<void>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:276
Cleanup agent resources.
Returns
Promise<void>
Inherited from
clearHistory()
protected clearHistory(): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:337
Returns
void
Inherited from
complete()
protected complete(request): Promise<Result<CompletionResponse, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:303
Parameters
request
Returns
Promise<Result<CompletionResponse, AgentError>>
Inherited from
execute()
execute(task, options?): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:218
Execute a task.
Parameters
task
Task to execute
options?
Optional execution options (#3016/#3040).
signal cancels the in-flight model call when the caller’s deadline
wins a race; without it, the SDK keeps running to its own 10-minute
timeout after the caller has already discarded the result.
signal?
AbortSignal
Returns
Promise<Result<TaskResult, AgentError>>
Result with TaskResult or AgentError
Inherited from
executeTask()
protected executeTask(task): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/experts/code-expert.ts:54
Execute a code-related task.
Parameters
task
Returns
Promise<Result<TaskResult, AgentError>>
Overrides
findResolutionForError()
protected findResolutionForError(errorMessage): ErrorResolution | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:393
Parameters
errorMessage
string
Returns
ErrorResolution | undefined
Inherited from
BaseAgent.findResolutionForError
flushMemory()
flushMemory(): Promise<Result<void, AgentMemoryError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:371
Returns
Promise<Result<void, AgentMemoryError>>
Inherited from
getExpertOptions()
getExpertOptions(): Readonly<CodeExpertOptions>;
Defined in: packages/nexus-agents/src/agents/experts/code-expert.ts:95
Get the expert options.
Returns
Readonly<CodeExpertOptions>
getHistory()
protected getHistory(): Message[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:334
Returns
Message[]
Inherited from
getMemoryState()
getMemoryState(): Readonly<AgentMemoryState> | null;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:364
Returns
Readonly<AgentMemoryState> | null
Inherited from
getPruningMetrics()
getPruningMetrics(): Readonly<ContextPruningMetrics>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:340
Returns
Readonly<ContextPruningMetrics>
Inherited from
getRelevantMemories()
getRelevantMemories(): readonly TypedMemoryEntry<MemoryType>[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:367
Returns
readonly TypedMemoryEntry<MemoryType>[]
Inherited from
getTaskLearnings()
protected getTaskLearnings(taskType): readonly TaskLearning[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:396
Parameters
taskType
string
Returns
readonly TaskLearning[]
Inherited from
handleMessage()
handleMessage(msg): Promise<Result<AgentResponse, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:261
Handle an inter-agent message and return a response.
Delivery semantics (#3222). This is a direct, awaited request/response
call: the caller invokes it and holds the returned promise. It is NOT a
queued or broadcast channel — that is the collaboration event bus
(agents/collaboration/event-bus.ts), a fire-and-forget pub/sub with its
own semantics. For this method specifically:
- Ordering is the caller’s responsibility. Sequential
awaits are handled in call order; concurrent calls carry no cross-message ordering guarantee. - Delivery is exactly the method invocation — there is no automatic
retry or redelivery. A returned
err(...)is the caller’s signal to decide whether to retry; the agent does not re-queue the message. - Errors surface as
Result.err, not as a throw for expected conditions; the caller branches on theResult.
Parameters
msg
Message to handle
Returns
Promise<Result<AgentResponse, AgentError>>
Result with AgentResponse, or AgentError on failure (not retried)
Inherited from
hasCapability()
hasCapability(capability): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:292
Parameters
capability
Returns
boolean
Inherited from
initialize()
initialize(ctx): Promise<Result<void, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:205
Initialize the agent with context.
Parameters
ctx
AgentContext
Agent context
Returns
Promise<Result<void, AgentError>>
Result with void or AgentError
Inherited from
isContextPruningEnabled()
isContextPruningEnabled(): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:358
Returns
boolean
Inherited from
BaseAgent.isContextPruningEnabled
isMemoryEnabled()
isMemoryEnabled(): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:361
Returns
boolean
Inherited from
recordLearning()
protected recordLearning(learning): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:384
Parameters
learning
Omit<TaskLearning, "id" | "learnedAt">
Returns
void
Inherited from
recordPattern()
protected recordPattern(p): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:387
Parameters
p
Omit<ExecutionPattern, "id" | "lastSeen" | "occurrences">
Returns
void
Inherited from
recordResolution()
protected recordResolution(r): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:390
Parameters
r
Omit<ErrorResolution, "resolvedAt">
Returns
void
Inherited from
transformError()
protected transformError(error, taskId): AgentError;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:299
Parameters
error
unknown
taskId
string
Returns
Inherited from
CollaborationSession
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:49
Manages a collaboration session between multiple experts.
Constructors
Constructor
new CollaborationSession(options?): CollaborationSession;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:59
Parameters
options?
CollaborationSessionOptions = {}
Returns
Methods
addEventListener()
addEventListener(listener): void;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:359
Parameters
listener
(event) => void
Returns
void
cancel()
cancel(reason): void;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:349
Parameters
reason
string
Returns
void
finalize()
finalize(): Result<CollaborationResult, AgentError>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:298
Finalizes the session and returns aggregated result.
Returns
Result<CollaborationResult, AgentError>
getSessionId()
getSessionId(): string | null;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:247
Returns
string | null
getStatus()
getStatus(): SessionState | null;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:244
Returns
SessionState | null
getTaskAssignments()
getTaskAssignments(): TaskAssignmentMessage[];
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:291
Gets task assignments for experts based on pattern.
Returns
markExpertFailed()
markExpertFailed(expertId, error): Result<void, AgentError>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:252
Marks an expert as failed.
Parameters
expertId
string
error
string
Returns
Result<void, AgentError>
removeEventListener()
removeEventListener(listener): void;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:370
Parameters
listener
(event) => void
Returns
void
requestReview()
requestReview(
fromExpert,
toExpert,
artifact
): Result<void, AgentError>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:150
Requests a review from one expert to another.
Parameters
fromExpert
string
toExpert
string
artifact
unknown
Returns
Result<void, AgentError>
start()
start(config): Result<string, AgentError>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:68
Starts a new collaboration session.
Parameters
config
Returns
Result<string, AgentError>
submitResult()
submitResult(expertId, result): Result<void, AgentError>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:118
Submits a result from an expert.
Parameters
expertId
string
result
Returns
Result<void, AgentError>
submitReview()
submitReview(
reviewerId,
requesterId,
approved,
feedback
): Result<void, AgentError>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:171
Submits a review response.
Parameters
reviewerId
string
requesterId
string
approved
boolean
feedback
string
Returns
Result<void, AgentError>
vote()
vote(
expertId,
decision,
reasoning
): Result<void, AgentError>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:201
Submits a vote for consensus protocol.
Parameters
expertId
string
decision
"approve" | "reject" | "abstain"
reasoning
string
Returns
Result<void, AgentError>
ConsensusProtocol
Defined in: packages/nexus-agents/src/agents/collaboration/consensus-protocol.ts:22
Consensus collaboration protocol.
Implements
Constructors
Constructor
new ConsensusProtocol(options?): ConsensusProtocol;
Defined in: packages/nexus-agents/src/agents/collaboration/consensus-protocol.ts:29
Parameters
options?
ProtocolOptions = {}
Returns
Properties
cancelled
protected cancelled: boolean = false;
Defined in: packages/nexus-agents/src/agents/collaboration/consensus-protocol.ts:26
logger
protected readonly logger: ILogger;
Defined in: packages/nexus-agents/src/agents/collaboration/consensus-protocol.ts:24
options
protected readonly options: ProtocolOptions;
Defined in: packages/nexus-agents/src/agents/collaboration/consensus-protocol.ts:27
pattern
readonly pattern: "consensus";
Defined in: packages/nexus-agents/src/agents/collaboration/consensus-protocol.ts:23
Implementation of
ICollaborationProtocol.pattern
session
protected session: CollaborationSession | null = null;
Defined in: packages/nexus-agents/src/agents/collaboration/consensus-protocol.ts:25
Methods
cancel()
cancel(reason): void;
Defined in: packages/nexus-agents/src/agents/collaboration/consensus-protocol.ts:34
Parameters
reason
string
Returns
void
Implementation of
execute()
execute(config, agents): Promise<Result<CollaborationResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/collaboration/consensus-protocol.ts:40
Parameters
config
agents
Map<string, IAgent>
Returns
Promise<Result<CollaborationResult, AgentError>>
Implementation of
ICollaborationProtocol.execute
ContextManager
Defined in: packages/nexus-agents/src/agents/context-manager.ts:58
Manages context window for agents with token budget enforcement.
Constructors
Constructor
new ContextManager(config): ContextManager;
Defined in: packages/nexus-agents/src/agents/context-manager.ts:71
Parameters
config
Returns
Methods
add()
add(item): Promise<Result<ContextItem, ValidationError>>;
Defined in: packages/nexus-agents/src/agents/context-manager.ts:90
Add an item to the context. Returns Result with the added item or error.
Parameters
item
Omit<ContextItem, "tokenCount" | "addedAt">
Returns
Promise<Result<ContextItem, ValidationError>>
buildMessages()
buildMessages(): Message[];
Defined in: packages/nexus-agents/src/agents/context-manager.ts:247
Build messages array from context items for model requests.
Returns
Message[]
canAdd()
canAdd(content, category): Promise<boolean>;
Defined in: packages/nexus-agents/src/agents/context-manager.ts:221
Check if an item with the given content can be added to a category.
Parameters
content
string
category
"system" | "task" | "active"
Returns
Promise<boolean>
clear()
clear(): void;
Defined in: packages/nexus-agents/src/agents/context-manager.ts:280
Clear all items from the context.
Returns
void
clearCategory()
clearCategory(category): number;
Defined in: packages/nexus-agents/src/agents/context-manager.ts:288
Clear items from a specific category. Returns number of items removed.
Parameters
category
"system" | "task" | "active"
Returns
number
countTokens()
countTokens(text): Promise<number>;
Defined in: packages/nexus-agents/src/agents/context-manager.ts:308
Count tokens in text using adapter or fallback estimation.
Parameters
text
string
Returns
Promise<number>
get()
get(id): ContextItem | undefined;
Defined in: packages/nexus-agents/src/agents/context-manager.ts:216
Get an item by ID.
Parameters
id
string
Returns
ContextItem | undefined
getAllItems()
getAllItems(): ContextItem[];
Defined in: packages/nexus-agents/src/agents/context-manager.ts:242
Get all items sorted by priority (desc) then addedAt (asc).
Returns
getByCategory()
getByCategory(category): ContextItem[];
Defined in: packages/nexus-agents/src/agents/context-manager.ts:237
Get all items in a category, sorted by priority (desc) then addedAt (asc).
Parameters
category
"system" | "task" | "active"
Returns
getRemainingTokens()
getRemainingTokens(category): number;
Defined in: packages/nexus-agents/src/agents/context-manager.ts:267
Get remaining tokens available in a category.
Parameters
category
"system" | "task" | "active"
Returns
number
getStats()
getStats(): ContextStats;
Defined in: packages/nexus-agents/src/agents/context-manager.ts:257
Get current context statistics.
Returns
getSystemPrompt()
getSystemPrompt(): string | undefined;
Defined in: packages/nexus-agents/src/agents/context-manager.ts:252
Get the system prompt from system category items.
Returns
string | undefined
getTotalRemainingTokens()
getTotalRemainingTokens(): number;
Defined in: packages/nexus-agents/src/agents/context-manager.ts:274
Get total remaining tokens across all categories.
Returns
number
remove()
remove(id): boolean;
Defined in: packages/nexus-agents/src/agents/context-manager.ts:200
Remove an item from the context. Returns true if removed, false if not found.
Parameters
id
string
Returns
boolean
ContextPruner
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:96
Handles context pruning with multiple strategies.
Constructors
Constructor
new ContextPruner(config): ContextPruner;
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:105
Parameters
config
Returns
Methods
estimateFreeableTokens()
estimateFreeableTokens(categories): number;
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:193
Estimate tokens that can be freed from specified categories.
Parameters
categories
("system" | "task" | "active")[]
Returns
number
getPruneCandidates()
getPruneCandidates(categories): ContextItem[];
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:184
Get candidates for pruning from specified categories.
Parameters
categories
("system" | "task" | "active")[]
Returns
prune()
prune(options?): Promise<Result<PruneResult, ValidationError>>;
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:132
Prune context to free tokens or reach target capacity.
Parameters
options?
PruneOptions = {}
Returns
Promise<Result<PruneResult, ValidationError>>
pruneCategory()
pruneCategory(category, targetTokens): Promise<Result<PruneResult, ValidationError>>;
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:176
Prune items from a specific category.
Parameters
category
"system" | "task" | "active"
targetTokens
number
Returns
Promise<Result<PruneResult, ValidationError>>
shouldPrune()
shouldPrune(): boolean;
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:127
Check if pruning should be triggered based on usage threshold.
Returns
boolean
DocumentationExpert
Defined in: packages/nexus-agents/src/agents/experts/documentation-expert.ts:52
DocumentationExpert - Expert agent for documentation-related tasks.
Extends
Constructors
Constructor
new DocumentationExpert(options?): DocumentationExpert;
Defined in: packages/nexus-agents/src/agents/experts/documentation-expert.ts:55
Parameters
options?
Partial<BaseAgentOptions> & {
expertOptions?: DocumentationExpertOptions;
} = {}
Returns
Overrides
Properties
adapter
protected adapter: IModelAdapter | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:98
Inherited from
budgetTracker
protected readonly budgetTracker: ITokenBudgetTracker;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:97
Inherited from
capabilities
readonly capabilities: readonly AgentCapability[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:95
Agent capabilities
Inherited from
config
protected config: AgentConfig | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:100
Inherited from
emitMessageEvents
protected readonly emitMessageEvents: boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:107
Inherited from
eventBus
protected readonly eventBus: ICollaborationEventBus;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:106
Inherited from
history
protected history: Message[] = [];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:102
Inherited from
id
readonly id: string;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:93
Unique agent identifier
Inherited from
logger
protected readonly logger: ILogger;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:99
Inherited from
maxTokens
protected readonly maxTokens: number;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:105
Inherited from
role
readonly role: AgentRole;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:94
Agent role
Inherited from
sharedState
protected sharedState: Record<string, unknown> = {};
Defined in: packages/nexus-agents/src/agents/base-agent.ts:101
Inherited from
stateMachine
protected readonly stateMachine: AgentStateMachine;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:96
Inherited from
systemPrompt
protected readonly systemPrompt: string | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:103
Inherited from
temperature
protected readonly temperature: number;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:104
Inherited from
Accessors
state
Get Signature
get state(): AgentState;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:176
Current state
Returns
Current state
Inherited from
Methods
addContextItem()
protected addContextItem(
content,
priority?,
category?
): Promise<void>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:344
Parameters
content
string
priority?
100 | 20 | 60 | 80 | 40
category?
"system" | "task" | "active"
Returns
Promise<void>
Inherited from
addToHistory()
protected addToHistory(message): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:331
Parameters
message
Returns
void
Inherited from
buildPrompt()
protected buildPrompt(task): Message[];
Defined in: packages/nexus-agents/src/agents/experts/documentation-expert.ts:83
Parameters
task
Returns
Message[]
Overrides
cleanup()
cleanup(): Promise<void>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:276
Cleanup agent resources.
Returns
Promise<void>
Inherited from
clearHistory()
protected clearHistory(): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:337
Returns
void
Inherited from
complete()
protected complete(request): Promise<Result<CompletionResponse, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:303
Parameters
request
Returns
Promise<Result<CompletionResponse, AgentError>>
Inherited from
execute()
execute(task, options?): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:218
Execute a task.
Parameters
task
Task to execute
options?
Optional execution options (#3016/#3040).
signal cancels the in-flight model call when the caller’s deadline
wins a race; without it, the SDK keeps running to its own 10-minute
timeout after the caller has already discarded the result.
signal?
AbortSignal
Returns
Promise<Result<TaskResult, AgentError>>
Result with TaskResult or AgentError
Inherited from
executeTask()
protected executeTask(task): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/experts/documentation-expert.ts:65
Parameters
task
Returns
Promise<Result<TaskResult, AgentError>>
Overrides
findResolutionForError()
protected findResolutionForError(errorMessage): ErrorResolution | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:393
Parameters
errorMessage
string
Returns
ErrorResolution | undefined
Inherited from
BaseAgent.findResolutionForError
flushMemory()
flushMemory(): Promise<Result<void, AgentMemoryError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:371
Returns
Promise<Result<void, AgentMemoryError>>
Inherited from
getExpertOptions()
getExpertOptions(): Readonly<DocumentationExpertOptions>;
Defined in: packages/nexus-agents/src/agents/experts/documentation-expert.ts:99
Returns
Readonly<DocumentationExpertOptions>
getHistory()
protected getHistory(): Message[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:334
Returns
Message[]
Inherited from
getMemoryState()
getMemoryState(): Readonly<AgentMemoryState> | null;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:364
Returns
Readonly<AgentMemoryState> | null
Inherited from
getPruningMetrics()
getPruningMetrics(): Readonly<ContextPruningMetrics>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:340
Returns
Readonly<ContextPruningMetrics>
Inherited from
getRelevantMemories()
getRelevantMemories(): readonly TypedMemoryEntry<MemoryType>[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:367
Returns
readonly TypedMemoryEntry<MemoryType>[]
Inherited from
getTaskLearnings()
protected getTaskLearnings(taskType): readonly TaskLearning[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:396
Parameters
taskType
string
Returns
readonly TaskLearning[]
Inherited from
handleMessage()
handleMessage(msg): Promise<Result<AgentResponse, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:261
Handle an inter-agent message and return a response.
Delivery semantics (#3222). This is a direct, awaited request/response
call: the caller invokes it and holds the returned promise. It is NOT a
queued or broadcast channel — that is the collaboration event bus
(agents/collaboration/event-bus.ts), a fire-and-forget pub/sub with its
own semantics. For this method specifically:
- Ordering is the caller’s responsibility. Sequential
awaits are handled in call order; concurrent calls carry no cross-message ordering guarantee. - Delivery is exactly the method invocation — there is no automatic
retry or redelivery. A returned
err(...)is the caller’s signal to decide whether to retry; the agent does not re-queue the message. - Errors surface as
Result.err, not as a throw for expected conditions; the caller branches on theResult.
Parameters
msg
Message to handle
Returns
Promise<Result<AgentResponse, AgentError>>
Result with AgentResponse, or AgentError on failure (not retried)
Inherited from
hasCapability()
hasCapability(capability): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:292
Parameters
capability
Returns
boolean
Inherited from
initialize()
initialize(ctx): Promise<Result<void, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:205
Initialize the agent with context.
Parameters
ctx
AgentContext
Agent context
Returns
Promise<Result<void, AgentError>>
Result with void or AgentError
Inherited from
isContextPruningEnabled()
isContextPruningEnabled(): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:358
Returns
boolean
Inherited from
BaseAgent.isContextPruningEnabled
isMemoryEnabled()
isMemoryEnabled(): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:361
Returns
boolean
Inherited from
recordLearning()
protected recordLearning(learning): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:384
Parameters
learning
Omit<TaskLearning, "id" | "learnedAt">
Returns
void
Inherited from
recordPattern()
protected recordPattern(p): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:387
Parameters
p
Omit<ExecutionPattern, "id" | "lastSeen" | "occurrences">
Returns
void
Inherited from
recordResolution()
protected recordResolution(r): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:390
Parameters
r
Omit<ErrorResolution, "resolvedAt">
Returns
void
Inherited from
transformError()
protected transformError(error, taskId): AgentError;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:299
Parameters
error
unknown
taskId
string
Returns
Inherited from
Expert
Defined in: packages/nexus-agents/src/agents/experts/expert-agent.ts:17
Expert agent extending SimpleAgent with configuration-based setup.
Extends
Extended by
Constructors
Constructor
new Expert(options, config): Expert;
Defined in: packages/nexus-agents/src/agents/experts/expert-agent.ts:20
Parameters
options
config
Returns
Overrides
Properties
adapter
protected adapter: IModelAdapter | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:98
Inherited from
budgetTracker
protected readonly budgetTracker: ITokenBudgetTracker;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:97
Inherited from
capabilities
readonly capabilities: readonly AgentCapability[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:95
Agent capabilities
Inherited from
config
protected config: AgentConfig | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:100
Inherited from
emitMessageEvents
protected readonly emitMessageEvents: boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:107
Inherited from
eventBus
protected readonly eventBus: ICollaborationEventBus;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:106
Inherited from
expertConfig
readonly expertConfig: ExpertConfig;
Defined in: packages/nexus-agents/src/agents/experts/expert-agent.ts:18
history
protected history: Message[] = [];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:102
Inherited from
id
readonly id: string;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:93
Unique agent identifier
Inherited from
logger
protected readonly logger: ILogger;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:99
Inherited from
maxTokens
protected readonly maxTokens: number;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:105
Inherited from
role
readonly role: AgentRole;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:94
Agent role
Inherited from
sharedState
protected sharedState: Record<string, unknown> = {};
Defined in: packages/nexus-agents/src/agents/base-agent.ts:101
Inherited from
stateMachine
protected readonly stateMachine: AgentStateMachine;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:96
Inherited from
systemPrompt
protected readonly systemPrompt: string | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:103
Inherited from
temperature
protected readonly temperature: number;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:104
Inherited from
Accessors
metadata
Get Signature
get metadata(): Record<string, unknown> | undefined;
Defined in: packages/nexus-agents/src/agents/experts/expert-agent.ts:35
Get the expert’s metadata.
Returns
Record<string, unknown> | undefined
name
Get Signature
get name(): string;
Defined in: packages/nexus-agents/src/agents/experts/expert-agent.ts:28
Get the expert’s name.
Returns
string
state
Get Signature
get state(): AgentState;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:176
Current state
Returns
Current state
Inherited from
Methods
addContextItem()
protected addContextItem(
content,
priority?,
category?
): Promise<void>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:344
Parameters
content
string
priority?
100 | 20 | 60 | 80 | 40
category?
"system" | "task" | "active"
Returns
Promise<void>
Inherited from
addToHistory()
protected addToHistory(message): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:331
Parameters
message
Returns
void
Inherited from
buildPrompt()
protected buildPrompt(task): Message[];
Defined in: packages/nexus-agents/src/agents/simple-agent.ts:105
Build prompt messages from a task.
Parameters
task
Returns
Message[]
Inherited from
cleanup()
cleanup(): Promise<void>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:276
Cleanup agent resources.
Returns
Promise<void>
Inherited from
clearHistory()
protected clearHistory(): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:337
Returns
void
Inherited from
complete()
protected complete(request): Promise<Result<CompletionResponse, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:303
Parameters
request
Returns
Promise<Result<CompletionResponse, AgentError>>
Inherited from
execute()
execute(task, options?): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:218
Execute a task.
Parameters
task
Task to execute
options?
Optional execution options (#3016/#3040).
signal cancels the in-flight model call when the caller’s deadline
wins a race; without it, the SDK keeps running to its own 10-minute
timeout after the caller has already discarded the result.
signal?
AbortSignal
Returns
Promise<Result<TaskResult, AgentError>>
Result with TaskResult or AgentError
Inherited from
executeTask()
protected executeTask(task): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/simple-agent.ts:21
Execute a task by sending it to the model.
Parameters
task
Returns
Promise<Result<TaskResult, AgentError>>
Inherited from
findResolutionForError()
protected findResolutionForError(errorMessage): ErrorResolution | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:393
Parameters
errorMessage
string
Returns
ErrorResolution | undefined
Inherited from
SimpleAgent.findResolutionForError
flushMemory()
flushMemory(): Promise<Result<void, AgentMemoryError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:371
Returns
Promise<Result<void, AgentMemoryError>>
Inherited from
getHistory()
protected getHistory(): Message[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:334
Returns
Message[]
Inherited from
getMemoryState()
getMemoryState(): Readonly<AgentMemoryState> | null;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:364
Returns
Readonly<AgentMemoryState> | null
Inherited from
getPruningMetrics()
getPruningMetrics(): Readonly<ContextPruningMetrics>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:340
Returns
Readonly<ContextPruningMetrics>
Inherited from
getRelevantMemories()
getRelevantMemories(): readonly TypedMemoryEntry<MemoryType>[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:367
Returns
readonly TypedMemoryEntry<MemoryType>[]
Inherited from
SimpleAgent.getRelevantMemories
getTaskLearnings()
protected getTaskLearnings(taskType): readonly TaskLearning[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:396
Parameters
taskType
string
Returns
readonly TaskLearning[]
Inherited from
handleMessage()
handleMessage(msg): Promise<Result<AgentResponse, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:261
Handle an inter-agent message and return a response.
Delivery semantics (#3222). This is a direct, awaited request/response
call: the caller invokes it and holds the returned promise. It is NOT a
queued or broadcast channel — that is the collaboration event bus
(agents/collaboration/event-bus.ts), a fire-and-forget pub/sub with its
own semantics. For this method specifically:
- Ordering is the caller’s responsibility. Sequential
awaits are handled in call order; concurrent calls carry no cross-message ordering guarantee. - Delivery is exactly the method invocation — there is no automatic
retry or redelivery. A returned
err(...)is the caller’s signal to decide whether to retry; the agent does not re-queue the message. - Errors surface as
Result.err, not as a throw for expected conditions; the caller branches on theResult.
Parameters
msg
Message to handle
Returns
Promise<Result<AgentResponse, AgentError>>
Result with AgentResponse, or AgentError on failure (not retried)
Inherited from
hasCapability()
hasCapability(capability): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:292
Parameters
capability
Returns
boolean
Inherited from
initialize()
initialize(ctx): Promise<Result<void, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:205
Initialize the agent with context.
Parameters
ctx
AgentContext
Agent context
Returns
Promise<Result<void, AgentError>>
Result with void or AgentError
Inherited from
isContextPruningEnabled()
isContextPruningEnabled(): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:358
Returns
boolean
Inherited from
SimpleAgent.isContextPruningEnabled
isMemoryEnabled()
isMemoryEnabled(): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:361
Returns
boolean
Inherited from
recordLearning()
protected recordLearning(learning): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:384
Parameters
learning
Omit<TaskLearning, "id" | "learnedAt">
Returns
void
Inherited from
recordPattern()
protected recordPattern(p): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:387
Parameters
p
Omit<ExecutionPattern, "id" | "lastSeen" | "occurrences">
Returns
void
Inherited from
recordResolution()
protected recordResolution(r): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:390
Parameters
r
Omit<ErrorResolution, "resolvedAt">
Returns
void
Inherited from
transformError()
protected transformError(error, taskId): AgentError;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:299
Parameters
error
unknown
taskId
string
Returns
Inherited from
ExpertRegistry
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:68
Singleton registry for managing expert agents.
Provides thread-safe registration and lookup of experts. Supports querying by ID, role, and capabilities.
Implements IRegistry<Expert, RegistryError> for unified registry API.
Implements
IRegistry<Expert,RegistryError>
Accessors
isEmpty
Get Signature
get isEmpty(): boolean;
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:319
Check if the registry is empty.
Returns
boolean
Implementation of
IRegistry.isEmpty
size
Get Signature
get size(): number;
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:312
Get the number of registered experts.
Returns
number
Implementation of
IRegistry.size
Methods
clear()
clear(): void;
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:326
Clear all registered experts.
Returns
void
Implementation of
IRegistry.clear
findBestMatch()
findBestMatch(requiredCapabilities): Result<Expert, RegistryError>;
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:363
Find the best expert for a set of required capabilities.
Returns the expert that matches the most capabilities.
Parameters
requiredCapabilities
Capabilities needed
Returns
Result with best Expert or RegistryError if none found
get()
get(id): Result<Expert, RegistryError>;
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:163
Get an expert by ID.
Parameters
id
string
Expert ID to retrieve
Returns
Result with Expert or RegistryError
Implementation of
IRegistry.get
getAll()
getAll(): Expert[];
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:274
Get all registered experts. IRegistry interface method.
Returns
Expert[]
Array of all registered experts
Implementation of
IRegistry.getAll
getAllIds()
getAllIds(): string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:284
Get all registered expert IDs. IRegistry interface method.
Returns
string[]
Array of all registered expert IDs
Implementation of
IRegistry.getAllIds
getByCapability()
getByCapability(capability): Expert[];
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:198
Get experts by capability.
Returns all experts that have the specified capability.
Parameters
capability
Capability to search for
Returns
Expert[]
Array of matching experts
getByRole()
getByRole(role): Expert[];
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:210
Get experts by role.
Parameters
role
string
Role to search for
Returns
Expert[]
Array of matching experts
getStats()
getStats(): RegistryStats;
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:334
Get statistics about the registry. Returns IRegistryStats-compatible stats with domain-specific extensions.
Returns
Implementation of
IRegistry.getStats
has()
has(id): boolean;
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:186
Check if an expert is registered.
Parameters
id
string
Expert ID to check
Returns
boolean
True if expert is registered
Implementation of
IRegistry.has
query()
query(predicate): Expert[];
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:260
Query experts with predicate function. IRegistry interface method.
Parameters
predicate
(item) => boolean
Function to test each expert
Returns
Expert[]
Array of matching experts
Implementation of
IRegistry.query
queryWithOptions()
queryWithOptions(options): Expert[];
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:221
Query experts with multiple criteria. Domain-specific query with structured options.
Parameters
options
Query options
Returns
Expert[]
Array of matching experts
register()
register(expert, options?): Result<void, RegistryError>;
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:101
Register an expert in the registry.
Parameters
expert
Expert to register
options?
Registration options
Returns
Result<void, RegistryError>
Result with void or RegistryError
Implementation of
IRegistry.register
registerMany()
registerMany(experts, options?): Result<void, RegistryError>;
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:126
Register multiple experts.
Parameters
experts
Expert[]
Experts to register
options?
Registration options
Returns
Result<void, RegistryError>
Result with void or first RegistryError
search()
search(searchTerm): Expert[];
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:297
Search experts by text query. IRegistry interface method.
Searches expert ID, name, role, and capabilities.
Parameters
searchTerm
string
Search term to match
Returns
Expert[]
Array of matching experts
Implementation of
IRegistry.search
unregister()
unregister(id): Result<Expert, RegistryError>;
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:142
Unregister an expert by ID.
Parameters
id
string
Expert ID to unregister
Returns
Result with the removed Expert or RegistryError
Implementation of
IRegistry.unregister
getInstance()
static getInstance(): ExpertRegistry;
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:79
Get the singleton instance.
Returns
resetInstance()
static resetInstance(): void;
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:87
Reset the singleton instance (for testing).
Returns
void
FactoryError
Defined in: packages/nexus-agents/src/agents/experts/expert-factory.ts:37
Error specific to factory operations.
Extends
Constructors
Constructor
new FactoryError(message, options?): FactoryError;
Defined in: packages/nexus-agents/src/agents/experts/expert-factory.ts:38
Parameters
message
string
options?
cause?
Error
context?
Record<string, unknown>
Returns
Overrides
Properties
cause
readonly cause: Error | undefined;
Defined in: packages/nexus-agents/src/core/errors.ts:105
Inherited from
code
readonly code: ErrorCode;
Defined in: packages/nexus-agents/src/core/errors.ts:103
Inherited from
context
readonly context: Record<string, unknown> | undefined;
Defined in: packages/nexus-agents/src/core/errors.ts:104
Inherited from
message
message: string;
Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
Inherited from
name
name: string;
Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
Inherited from
stack?
optional stack?: string;
Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
stackTraceLimit
static stackTraceLimit: number;
Defined in: node_modules/.pnpm/@types+node@25.9.8/node_modules/@types/node/globals.d.ts:67
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Methods
toJSON()
toJSON(): SerializedError;
Defined in: packages/nexus-agents/src/core/errors.ts:121
Serializes the error to a JSON-safe object.
Returns
Inherited from
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;
Defined in: node_modules/.pnpm/@types+node@25.9.8/node_modules/@types/node/globals.d.ts:51
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters
targetObject
object
constructorOpt?
Function
Returns
void
Inherited from
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;
Defined in: node_modules/.pnpm/@types+node@25.9.8/node_modules/@types/node/globals.d.ts:55
Parameters
err
Error
stackTraces
CallSite[]
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Orchestrator
Defined in: packages/nexus-agents/src/agents/tech-lead.ts:202
Agents exports - Agent framework, Orchestrator, Experts Split from index.ts for file size compliance (Issue #285)
Extends
Constructors
Constructor
new Orchestrator(options?): Orchestrator;
Defined in: packages/nexus-agents/src/agents/tech-lead.ts:208
Parameters
options?
Partial<BaseAgentOptions> & OrchestratorExtendedOptions & {
techLeadOptions?: OrchestratorOptions;
} = {}
Returns
Overrides
Properties
adapter
protected adapter: IModelAdapter | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:98
Inherited from
budgetTracker
protected readonly budgetTracker: ITokenBudgetTracker;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:97
Inherited from
capabilities
readonly capabilities: readonly AgentCapability[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:95
Agent capabilities
Inherited from
config
protected config: AgentConfig | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:100
Inherited from
emitMessageEvents
protected readonly emitMessageEvents: boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:107
Inherited from
eventBus
protected readonly eventBus: ICollaborationEventBus;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:106
Inherited from
history
protected history: Message[] = [];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:102
Inherited from
id
readonly id: string;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:93
Unique agent identifier
Inherited from
logger
protected readonly logger: ILogger;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:99
Inherited from
maxTokens
protected readonly maxTokens: number;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:105
Inherited from
role
readonly role: AgentRole;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:94
Agent role
Inherited from
sharedState
protected sharedState: Record<string, unknown> = {};
Defined in: packages/nexus-agents/src/agents/base-agent.ts:101
Inherited from
stateMachine
protected readonly stateMachine: AgentStateMachine;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:96
Inherited from
systemPrompt
protected readonly systemPrompt: string | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:103
Inherited from
temperature
protected readonly temperature: number;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:104
Inherited from
Accessors
state
Get Signature
get state(): AgentState;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:176
Current state
Returns
Current state
Inherited from
Methods
addContextItem()
protected addContextItem(
content,
priority?,
category?
): Promise<void>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:344
Parameters
content
string
priority?
100 | 20 | 60 | 80 | 40
category?
"system" | "task" | "active"
Returns
Promise<void>
Inherited from
addToHistory()
protected addToHistory(message): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:331
Parameters
message
Returns
void
Inherited from
analyzeTask()
analyzeTask(task): Promise<Result<TaskAnalysis, AgentError>>;
Defined in: packages/nexus-agents/src/agents/tech-lead.ts:308
Analyze a task to understand its complexity and requirements.
Parameters
task
Returns
Promise<Result<TaskAnalysis, AgentError>>
buildPrompt()
protected buildPrompt(task): Message[];
Defined in: packages/nexus-agents/src/agents/tech-lead.ts:303
Build prompt messages for task execution.
Parameters
task
Returns
Message[]
Overrides
cleanup()
cleanup(): Promise<void>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:276
Cleanup agent resources.
Returns
Promise<void>
Inherited from
clearHistory()
protected clearHistory(): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:337
Returns
void
Inherited from
complete()
protected complete(request): Promise<Result<CompletionResponse, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:303
Parameters
request
Returns
Promise<Result<CompletionResponse, AgentError>>
Inherited from
decomposeTask()
decomposeTask(task, analysis): Promise<Result<SubTask[], AgentError>>;
Defined in: packages/nexus-agents/src/agents/tech-lead.ts:350
Decompose a task into subtasks.
Parameters
task
analysis
Returns
Promise<Result<SubTask[], AgentError>>
execute()
execute(task, options?): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:218
Execute a task.
Parameters
task
Task to execute
options?
Optional execution options (#3016/#3040).
signal cancels the in-flight model call when the caller’s deadline
wins a race; without it, the SDK keeps running to its own 10-minute
timeout after the caller has already discarded the result.
signal?
AbortSignal
Returns
Promise<Result<TaskResult, AgentError>>
Result with TaskResult or AgentError
Inherited from
executeTask()
protected executeTask(task): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/tech-lead.ts:245
Execute a task by analyzing, decomposing (if needed), and coordinating.
Parameters
task
Returns
Promise<Result<TaskResult, AgentError>>
Overrides
findResolutionForError()
protected findResolutionForError(errorMessage): ErrorResolution | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:393
Parameters
errorMessage
string
Returns
ErrorResolution | undefined
Inherited from
BaseAgent.findResolutionForError
flushMemory()
flushMemory(): Promise<Result<void, AgentMemoryError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:371
Returns
Promise<Result<void, AgentMemoryError>>
Inherited from
getCollaborationHelper()
getCollaborationHelper(): OrchestratorCollaborationHelper;
Defined in: packages/nexus-agents/src/agents/tech-lead.ts:518
Get the collaboration helper for external use.
Returns
OrchestratorCollaborationHelper
getHistory()
protected getHistory(): Message[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:334
Returns
Message[]
Inherited from
getMemoryState()
getMemoryState(): Readonly<AgentMemoryState> | null;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:364
Returns
Readonly<AgentMemoryState> | null
Inherited from
getOptions()
getOptions(): Readonly<Required<OrchestratorOptions>>;
Defined in: packages/nexus-agents/src/agents/tech-lead.ts:523
Get the Orchestrator options.
Returns
Readonly<Required<OrchestratorOptions>>
getPruningMetrics()
getPruningMetrics(): Readonly<ContextPruningMetrics>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:340
Returns
Readonly<ContextPruningMetrics>
Inherited from
getRelevantMemories()
getRelevantMemories(): readonly TypedMemoryEntry<MemoryType>[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:367
Returns
readonly TypedMemoryEntry<MemoryType>[]
Inherited from
getTaskLearnings()
protected getTaskLearnings(taskType): readonly TaskLearning[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:396
Parameters
taskType
string
Returns
readonly TaskLearning[]
Inherited from
handleMessage()
handleMessage(msg): Promise<Result<AgentResponse, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:261
Handle an inter-agent message and return a response.
Delivery semantics (#3222). This is a direct, awaited request/response
call: the caller invokes it and holds the returned promise. It is NOT a
queued or broadcast channel — that is the collaboration event bus
(agents/collaboration/event-bus.ts), a fire-and-forget pub/sub with its
own semantics. For this method specifically:
- Ordering is the caller’s responsibility. Sequential
awaits are handled in call order; concurrent calls carry no cross-message ordering guarantee. - Delivery is exactly the method invocation — there is no automatic
retry or redelivery. A returned
err(...)is the caller’s signal to decide whether to retry; the agent does not re-queue the message. - Errors surface as
Result.err, not as a throw for expected conditions; the caller branches on theResult.
Parameters
msg
Message to handle
Returns
Promise<Result<AgentResponse, AgentError>>
Result with AgentResponse, or AgentError on failure (not retried)
Inherited from
hasCapability()
hasCapability(capability): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:292
Parameters
capability
Returns
boolean
Inherited from
initialize()
initialize(ctx): Promise<Result<void, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:205
Initialize the agent with context.
Parameters
ctx
AgentContext
Agent context
Returns
Promise<Result<void, AgentError>>
Result with void or AgentError
Inherited from
isContextPruningEnabled()
isContextPruningEnabled(): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:358
Returns
boolean
Inherited from
BaseAgent.isContextPruningEnabled
isMemoryEnabled()
isMemoryEnabled(): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:361
Returns
boolean
Inherited from
recordLearning()
protected recordLearning(learning): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:384
Parameters
learning
Omit<TaskLearning, "id" | "learnedAt">
Returns
void
Inherited from
recordPattern()
protected recordPattern(p): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:387
Parameters
p
Omit<ExecutionPattern, "id" | "lastSeen" | "occurrences">
Returns
void
Inherited from
recordResolution()
protected recordResolution(r): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:390
Parameters
r
Omit<ErrorResolution, "resolvedAt">
Returns
void
Inherited from
selectExperts()
selectExperts(subtasks): ExpertAssignment[];
Defined in: packages/nexus-agents/src/agents/tech-lead.ts:407
Select appropriate expert agents for each subtask.
Parameters
subtasks
SubTask[]
Returns
setExpertAgents()
setExpertAgents(agents): void;
Defined in: packages/nexus-agents/src/agents/tech-lead.ts:236
Set expert agents for collaboration (Issue #488). Call this to provide agents that can participate in collaborative synthesis.
Parameters
agents
Map<string, IAgent>
Returns
void
synthesizeResults()
synthesizeResults(results, originalTask?): Promise<Result<SynthesizedResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/tech-lead.ts:420
Synthesize results from multiple experts into a cohesive output.
Uses collaboration protocols for complex multi-expert synthesis (Issue #488) when enough experts and task complexity warrant it.
Parameters
results
Results to synthesize
originalTask?
Optional original task for context in collaborative synthesis
Returns
Promise<Result<SynthesizedResult, AgentError>>
transformError()
protected transformError(error, taskId): AgentError;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:299
Parameters
error
unknown
taskId
string
Returns
Inherited from
ParallelProtocol
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:209
Parallel collaboration protocol.
Extends
BaseProtocol
Constructors
Constructor
new ParallelProtocol(options?): ParallelProtocol;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:42
Parameters
options?
ProtocolOptions = {}
Returns
Inherited from
BaseProtocol.constructor
Properties
cancelled
protected cancelled: boolean = false;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:40
Inherited from
BaseProtocol.cancelled
logger
protected readonly logger: ILogger;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:38
Inherited from
BaseProtocol.logger
options
protected readonly options: ProtocolOptions = {};
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:42
Inherited from
BaseProtocol.options
pattern
readonly pattern: "parallel";
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:210
Overrides
BaseProtocol.pattern
session
protected session: CollaborationSession | null = null;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:39
Inherited from
BaseProtocol.session
Methods
cancel()
cancel(reason): void;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:51
Parameters
reason
string
Returns
void
Inherited from
BaseProtocol.cancel
createSession()
protected createSession(): CollaborationSession;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:57
Returns
Inherited from
BaseProtocol.createSession
execute()
execute(config, agents): Promise<Result<CollaborationResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:212
Parameters
config
agents
Map<string, IAgent>
Returns
Promise<Result<CollaborationResult, AgentError>>
Overrides
BaseProtocol.execute
executeAgentTask()
protected executeAgentTask(
agent,
task,
previousResults?
): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:62
Parameters
agent
task
previousResults?
Returns
Promise<Result<TaskResult, AgentError>>
Inherited from
BaseProtocol.executeAgentTask
validateAgents()
protected validateAgents(config, agents): Result<void, AgentError>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:85
Parameters
config
agents
Map<string, IAgent>
Returns
Result<void, AgentError>
Inherited from
BaseProtocol.validateAgents
ProtocolFactory
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:264
Factory for creating collaboration protocols.
Constructors
Constructor
new ProtocolFactory(options?): ProtocolFactory;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:267
Parameters
options?
ProtocolOptions = {}
Returns
Methods
create()
create(pattern): ICollaborationProtocol;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:271
Parameters
pattern
Returns
execute()
execute(config, agents): Promise<Result<CollaborationResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:300
Parameters
config
agents
Map<string, IAgent>
Returns
Promise<Result<CollaborationResult, AgentError>>
RecoverableExpert
Defined in: packages/nexus-agents/src/agents/experts/expert-recovery.ts:307
An Expert whose execute() applies a transient-vs-permanent recovery
policy. Wrapping at execute() (not executeTask()) reuses the base
state-machine auto-reset (#1060) and per-attempt heartbeat/timeout.
Extends
Constructors
Constructor
new RecoverableExpert(
options,
config,
policy
): RecoverableExpert;
Defined in: packages/nexus-agents/src/agents/experts/expert-recovery.ts:313
Parameters
options
config
policy
Returns
Overrides
Properties
adapter
protected adapter: IModelAdapter | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:98
Inherited from
budgetTracker
protected readonly budgetTracker: ITokenBudgetTracker;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:97
Inherited from
capabilities
readonly capabilities: readonly AgentCapability[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:95
Agent capabilities
Inherited from
config
protected config: AgentConfig | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:100
Inherited from
emitMessageEvents
protected readonly emitMessageEvents: boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:107
Inherited from
eventBus
protected readonly eventBus: ICollaborationEventBus;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:106
Inherited from
expertConfig
readonly expertConfig: ExpertConfig;
Defined in: packages/nexus-agents/src/agents/experts/expert-agent.ts:18
Inherited from
history
protected history: Message[] = [];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:102
Inherited from
id
readonly id: string;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:93
Unique agent identifier
Inherited from
logger
protected readonly logger: ILogger;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:99
Inherited from
maxTokens
protected readonly maxTokens: number;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:105
Inherited from
role
readonly role: AgentRole;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:94
Agent role
Inherited from
sharedState
protected sharedState: Record<string, unknown> = {};
Defined in: packages/nexus-agents/src/agents/base-agent.ts:101
Inherited from
stateMachine
protected readonly stateMachine: AgentStateMachine;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:96
Inherited from
systemPrompt
protected readonly systemPrompt: string | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:103
Inherited from
temperature
protected readonly temperature: number;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:104
Inherited from
Accessors
metadata
Get Signature
get metadata(): Record<string, unknown> | undefined;
Defined in: packages/nexus-agents/src/agents/experts/expert-agent.ts:35
Get the expert’s metadata.
Returns
Record<string, unknown> | undefined
Inherited from
name
Get Signature
get name(): string;
Defined in: packages/nexus-agents/src/agents/experts/expert-agent.ts:28
Get the expert’s name.
Returns
string
Inherited from
state
Get Signature
get state(): AgentState;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:176
Current state
Returns
Current state
Inherited from
Methods
addContextItem()
protected addContextItem(
content,
priority?,
category?
): Promise<void>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:344
Parameters
content
string
priority?
100 | 20 | 60 | 80 | 40
category?
"system" | "task" | "active"
Returns
Promise<void>
Inherited from
addToHistory()
protected addToHistory(message): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:331
Parameters
message
Returns
void
Inherited from
buildPrompt()
protected buildPrompt(task): Message[];
Defined in: packages/nexus-agents/src/agents/simple-agent.ts:105
Build prompt messages from a task.
Parameters
task
Returns
Message[]
Inherited from
cleanup()
cleanup(): Promise<void>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:276
Cleanup agent resources.
Returns
Promise<void>
Inherited from
clearHistory()
protected clearHistory(): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:337
Returns
void
Inherited from
complete()
protected complete(request): Promise<Result<CompletionResponse, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:303
Parameters
request
Returns
Promise<Result<CompletionResponse, AgentError>>
Inherited from
execute()
execute(task, options?): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/experts/expert-recovery.ts:328
Execute a task.
Parameters
task
Task to execute
options?
Optional execution options (#3016/#3040).
signal cancels the in-flight model call when the caller’s deadline
wins a race; without it, the SDK keeps running to its own 10-minute
timeout after the caller has already discarded the result.
signal?
AbortSignal
Returns
Promise<Result<TaskResult, AgentError>>
Result with TaskResult or AgentError
Overrides
executeTask()
protected executeTask(task): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/simple-agent.ts:21
Execute a task by sending it to the model.
Parameters
task
Returns
Promise<Result<TaskResult, AgentError>>
Inherited from
findResolutionForError()
protected findResolutionForError(errorMessage): ErrorResolution | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:393
Parameters
errorMessage
string
Returns
ErrorResolution | undefined
Inherited from
flushMemory()
flushMemory(): Promise<Result<void, AgentMemoryError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:371
Returns
Promise<Result<void, AgentMemoryError>>
Inherited from
getHistory()
protected getHistory(): Message[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:334
Returns
Message[]
Inherited from
getMemoryState()
getMemoryState(): Readonly<AgentMemoryState> | null;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:364
Returns
Readonly<AgentMemoryState> | null
Inherited from
getPruningMetrics()
getPruningMetrics(): Readonly<ContextPruningMetrics>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:340
Returns
Readonly<ContextPruningMetrics>
Inherited from
getRelevantMemories()
getRelevantMemories(): readonly TypedMemoryEntry<MemoryType>[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:367
Returns
readonly TypedMemoryEntry<MemoryType>[]
Inherited from
getTaskLearnings()
protected getTaskLearnings(taskType): readonly TaskLearning[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:396
Parameters
taskType
string
Returns
readonly TaskLearning[]
Inherited from
handleMessage()
handleMessage(msg): Promise<Result<AgentResponse, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:261
Handle an inter-agent message and return a response.
Delivery semantics (#3222). This is a direct, awaited request/response
call: the caller invokes it and holds the returned promise. It is NOT a
queued or broadcast channel — that is the collaboration event bus
(agents/collaboration/event-bus.ts), a fire-and-forget pub/sub with its
own semantics. For this method specifically:
- Ordering is the caller’s responsibility. Sequential
awaits are handled in call order; concurrent calls carry no cross-message ordering guarantee. - Delivery is exactly the method invocation — there is no automatic
retry or redelivery. A returned
err(...)is the caller’s signal to decide whether to retry; the agent does not re-queue the message. - Errors surface as
Result.err, not as a throw for expected conditions; the caller branches on theResult.
Parameters
msg
Message to handle
Returns
Promise<Result<AgentResponse, AgentError>>
Result with AgentResponse, or AgentError on failure (not retried)
Inherited from
hasCapability()
hasCapability(capability): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:292
Parameters
capability
Returns
boolean
Inherited from
initialize()
initialize(ctx): Promise<Result<void, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:205
Initialize the agent with context.
Parameters
ctx
AgentContext
Agent context
Returns
Promise<Result<void, AgentError>>
Result with void or AgentError
Inherited from
isContextPruningEnabled()
isContextPruningEnabled(): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:358
Returns
boolean
Inherited from
Expert.isContextPruningEnabled
isMemoryEnabled()
isMemoryEnabled(): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:361
Returns
boolean
Inherited from
recordLearning()
protected recordLearning(learning): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:384
Parameters
learning
Omit<TaskLearning, "id" | "learnedAt">
Returns
void
Inherited from
recordPattern()
protected recordPattern(p): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:387
Parameters
p
Omit<ExecutionPattern, "id" | "lastSeen" | "occurrences">
Returns
void
Inherited from
recordResolution()
protected recordResolution(r): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:390
Parameters
r
Omit<ErrorResolution, "resolvedAt">
Returns
void
Inherited from
transformError()
protected transformError(error, taskId): AgentError;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:299
Parameters
error
unknown
taskId
string
Returns
Inherited from
RegistryError
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:18
Error specific to registry operations.
Extends
Constructors
Constructor
new RegistryError(message, options?): RegistryError;
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:19
Parameters
message
string
options?
cause?
Error
context?
Record<string, unknown>
Returns
Overrides
Properties
cause
readonly cause: Error | undefined;
Defined in: packages/nexus-agents/src/core/errors.ts:105
Inherited from
code
readonly code: ErrorCode;
Defined in: packages/nexus-agents/src/core/errors.ts:103
Inherited from
context
readonly context: Record<string, unknown> | undefined;
Defined in: packages/nexus-agents/src/core/errors.ts:104
Inherited from
message
message: string;
Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
Inherited from
name
name: string;
Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
Inherited from
stack?
optional stack?: string;
Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
stackTraceLimit
static stackTraceLimit: number;
Defined in: node_modules/.pnpm/@types+node@25.9.8/node_modules/@types/node/globals.d.ts:67
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Methods
toJSON()
toJSON(): SerializedError;
Defined in: packages/nexus-agents/src/core/errors.ts:121
Serializes the error to a JSON-safe object.
Returns
Inherited from
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;
Defined in: node_modules/.pnpm/@types+node@25.9.8/node_modules/@types/node/globals.d.ts:51
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters
targetObject
object
constructorOpt?
Function
Returns
void
Inherited from
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;
Defined in: node_modules/.pnpm/@types+node@25.9.8/node_modules/@types/node/globals.d.ts:55
Parameters
err
Error
stackTraces
CallSite[]
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
ResultAggregator
Defined in: packages/nexus-agents/src/agents/collaboration/result-aggregator.ts:66
Agents exports - Agent framework, Orchestrator, Experts Split from index.ts for file size compliance (Issue #285)
Constructors
Constructor
new ResultAggregator(options?): ResultAggregator;
Defined in: packages/nexus-agents/src/agents/collaboration/result-aggregator.ts:72
Parameters
options?
AggregatorOptions = {}
Returns
Methods
aggregate()
aggregate(input): Result<AggregatedResult, AgentError>;
Defined in: packages/nexus-agents/src/agents/collaboration/result-aggregator.ts:82
Aggregates expert results into a final result.
Parameters
input
Returns
Result<AggregatedResult, AgentError>
ReviewProtocol
Defined in: packages/nexus-agents/src/agents/collaboration/review-protocol.ts:22
Review collaboration protocol.
Implements
Constructors
Constructor
new ReviewProtocol(options?): ReviewProtocol;
Defined in: packages/nexus-agents/src/agents/collaboration/review-protocol.ts:29
Parameters
options?
ProtocolOptions = {}
Returns
Properties
cancelled
protected cancelled: boolean = false;
Defined in: packages/nexus-agents/src/agents/collaboration/review-protocol.ts:26
logger
protected readonly logger: ILogger;
Defined in: packages/nexus-agents/src/agents/collaboration/review-protocol.ts:24
options
protected readonly options: ProtocolOptions;
Defined in: packages/nexus-agents/src/agents/collaboration/review-protocol.ts:27
pattern
readonly pattern: "review";
Defined in: packages/nexus-agents/src/agents/collaboration/review-protocol.ts:23
Implementation of
ICollaborationProtocol.pattern
session
protected session: CollaborationSession | null = null;
Defined in: packages/nexus-agents/src/agents/collaboration/review-protocol.ts:25
Methods
cancel()
cancel(reason): void;
Defined in: packages/nexus-agents/src/agents/collaboration/review-protocol.ts:34
Parameters
reason
string
Returns
void
Implementation of
execute()
execute(config, agents): Promise<Result<CollaborationResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/collaboration/review-protocol.ts:40
Parameters
config
agents
Map<string, IAgent>
Returns
Promise<Result<CollaborationResult, AgentError>>
Implementation of
ICollaborationProtocol.execute
SecurityExpert
Defined in: packages/nexus-agents/src/agents/experts/security-expert.ts:66
SecurityExpert - Expert agent for security-related tasks.
Extends
Constructors
Constructor
new SecurityExpert(options?): SecurityExpert;
Defined in: packages/nexus-agents/src/agents/experts/security-expert.ts:69
Parameters
options?
Partial<BaseAgentOptions> & {
expertOptions?: SecurityExpertOptions;
} = {}
Returns
Overrides
Properties
adapter
protected adapter: IModelAdapter | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:98
Inherited from
budgetTracker
protected readonly budgetTracker: ITokenBudgetTracker;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:97
Inherited from
capabilities
readonly capabilities: readonly AgentCapability[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:95
Agent capabilities
Inherited from
config
protected config: AgentConfig | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:100
Inherited from
emitMessageEvents
protected readonly emitMessageEvents: boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:107
Inherited from
eventBus
protected readonly eventBus: ICollaborationEventBus;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:106
Inherited from
history
protected history: Message[] = [];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:102
Inherited from
id
readonly id: string;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:93
Unique agent identifier
Inherited from
logger
protected readonly logger: ILogger;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:99
Inherited from
maxTokens
protected readonly maxTokens: number;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:105
Inherited from
role
readonly role: AgentRole;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:94
Agent role
Inherited from
sharedState
protected sharedState: Record<string, unknown> = {};
Defined in: packages/nexus-agents/src/agents/base-agent.ts:101
Inherited from
stateMachine
protected readonly stateMachine: AgentStateMachine;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:96
Inherited from
systemPrompt
protected readonly systemPrompt: string | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:103
Inherited from
temperature
protected readonly temperature: number;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:104
Inherited from
Accessors
state
Get Signature
get state(): AgentState;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:176
Current state
Returns
Current state
Inherited from
Methods
addContextItem()
protected addContextItem(
content,
priority?,
category?
): Promise<void>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:344
Parameters
content
string
priority?
100 | 20 | 60 | 80 | 40
category?
"system" | "task" | "active"
Returns
Promise<void>
Inherited from
addToHistory()
protected addToHistory(message): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:331
Parameters
message
Returns
void
Inherited from
buildPrompt()
protected buildPrompt(task): Message[];
Defined in: packages/nexus-agents/src/agents/experts/security-expert.ts:93
Parameters
task
Returns
Message[]
Overrides
cleanup()
cleanup(): Promise<void>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:276
Cleanup agent resources.
Returns
Promise<void>
Inherited from
clearHistory()
protected clearHistory(): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:337
Returns
void
Inherited from
complete()
protected complete(request): Promise<Result<CompletionResponse, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:303
Parameters
request
Returns
Promise<Result<CompletionResponse, AgentError>>
Inherited from
execute()
execute(task, options?): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:218
Execute a task.
Parameters
task
Task to execute
options?
Optional execution options (#3016/#3040).
signal cancels the in-flight model call when the caller’s deadline
wins a race; without it, the SDK keeps running to its own 10-minute
timeout after the caller has already discarded the result.
signal?
AbortSignal
Returns
Promise<Result<TaskResult, AgentError>>
Result with TaskResult or AgentError
Inherited from
executeTask()
protected executeTask(task): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/experts/security-expert.ts:77
Parameters
task
Returns
Promise<Result<TaskResult, AgentError>>
Overrides
findResolutionForError()
protected findResolutionForError(errorMessage): ErrorResolution | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:393
Parameters
errorMessage
string
Returns
ErrorResolution | undefined
Inherited from
BaseAgent.findResolutionForError
flushMemory()
flushMemory(): Promise<Result<void, AgentMemoryError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:371
Returns
Promise<Result<void, AgentMemoryError>>
Inherited from
getExpertOptions()
getExpertOptions(): Readonly<SecurityExpertOptions>;
Defined in: packages/nexus-agents/src/agents/experts/security-expert.ts:109
Returns
Readonly<SecurityExpertOptions>
getHistory()
protected getHistory(): Message[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:334
Returns
Message[]
Inherited from
getMemoryState()
getMemoryState(): Readonly<AgentMemoryState> | null;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:364
Returns
Readonly<AgentMemoryState> | null
Inherited from
getPruningMetrics()
getPruningMetrics(): Readonly<ContextPruningMetrics>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:340
Returns
Readonly<ContextPruningMetrics>
Inherited from
getRelevantMemories()
getRelevantMemories(): readonly TypedMemoryEntry<MemoryType>[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:367
Returns
readonly TypedMemoryEntry<MemoryType>[]
Inherited from
getTaskLearnings()
protected getTaskLearnings(taskType): readonly TaskLearning[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:396
Parameters
taskType
string
Returns
readonly TaskLearning[]
Inherited from
handleMessage()
handleMessage(msg): Promise<Result<AgentResponse, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:261
Handle an inter-agent message and return a response.
Delivery semantics (#3222). This is a direct, awaited request/response
call: the caller invokes it and holds the returned promise. It is NOT a
queued or broadcast channel — that is the collaboration event bus
(agents/collaboration/event-bus.ts), a fire-and-forget pub/sub with its
own semantics. For this method specifically:
- Ordering is the caller’s responsibility. Sequential
awaits are handled in call order; concurrent calls carry no cross-message ordering guarantee. - Delivery is exactly the method invocation — there is no automatic
retry or redelivery. A returned
err(...)is the caller’s signal to decide whether to retry; the agent does not re-queue the message. - Errors surface as
Result.err, not as a throw for expected conditions; the caller branches on theResult.
Parameters
msg
Message to handle
Returns
Promise<Result<AgentResponse, AgentError>>
Result with AgentResponse, or AgentError on failure (not retried)
Inherited from
hasCapability()
hasCapability(capability): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:292
Parameters
capability
Returns
boolean
Inherited from
initialize()
initialize(ctx): Promise<Result<void, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:205
Initialize the agent with context.
Parameters
ctx
AgentContext
Agent context
Returns
Promise<Result<void, AgentError>>
Result with void or AgentError
Inherited from
isContextPruningEnabled()
isContextPruningEnabled(): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:358
Returns
boolean
Inherited from
BaseAgent.isContextPruningEnabled
isMemoryEnabled()
isMemoryEnabled(): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:361
Returns
boolean
Inherited from
recordLearning()
protected recordLearning(learning): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:384
Parameters
learning
Omit<TaskLearning, "id" | "learnedAt">
Returns
void
Inherited from
recordPattern()
protected recordPattern(p): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:387
Parameters
p
Omit<ExecutionPattern, "id" | "lastSeen" | "occurrences">
Returns
void
Inherited from
recordResolution()
protected recordResolution(r): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:390
Parameters
r
Omit<ErrorResolution, "resolvedAt">
Returns
void
Inherited from
transformError()
protected transformError(error, taskId): AgentError;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:299
Parameters
error
unknown
taskId
string
Returns
Inherited from
SelectionError
Defined in: packages/nexus-agents/src/agents/experts/expert-selector.ts:58
Error thrown when expert selection fails.
Extends
Constructors
Constructor
new SelectionError(message, options?): SelectionError;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector.ts:59
Parameters
message
string
options?
cause?
Error
context?
Record<string, unknown>
Returns
Overrides
Properties
cause
readonly cause: Error | undefined;
Defined in: packages/nexus-agents/src/core/errors.ts:105
Inherited from
code
readonly code: ErrorCode;
Defined in: packages/nexus-agents/src/core/errors.ts:103
Inherited from
context
readonly context: Record<string, unknown> | undefined;
Defined in: packages/nexus-agents/src/core/errors.ts:104
Inherited from
message
message: string;
Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
Inherited from
name
name: string;
Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
Inherited from
stack?
optional stack?: string;
Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
stackTraceLimit
static stackTraceLimit: number;
Defined in: node_modules/.pnpm/@types+node@25.9.8/node_modules/@types/node/globals.d.ts:67
The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Methods
toJSON()
toJSON(): SerializedError;
Defined in: packages/nexus-agents/src/core/errors.ts:121
Serializes the error to a JSON-safe object.
Returns
Inherited from
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;
Defined in: node_modules/.pnpm/@types+node@25.9.8/node_modules/@types/node/globals.d.ts:51
Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames
above constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.
The constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();
Parameters
targetObject
object
constructorOpt?
Function
Returns
void
Inherited from
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;
Defined in: node_modules/.pnpm/@types+node@25.9.8/node_modules/@types/node/globals.d.ts:55
Parameters
err
Error
stackTraces
CallSite[]
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
SequentialProtocol
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:105
Sequential collaboration protocol.
Extends
BaseProtocol
Constructors
Constructor
new SequentialProtocol(options?): SequentialProtocol;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:42
Parameters
options?
ProtocolOptions = {}
Returns
Inherited from
BaseProtocol.constructor
Properties
cancelled
protected cancelled: boolean = false;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:40
Inherited from
BaseProtocol.cancelled
logger
protected readonly logger: ILogger;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:38
Inherited from
BaseProtocol.logger
options
protected readonly options: ProtocolOptions = {};
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:42
Inherited from
BaseProtocol.options
pattern
readonly pattern: "sequential";
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:106
Overrides
BaseProtocol.pattern
session
protected session: CollaborationSession | null = null;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:39
Inherited from
BaseProtocol.session
Methods
cancel()
cancel(reason): void;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:51
Parameters
reason
string
Returns
void
Inherited from
BaseProtocol.cancel
createSession()
protected createSession(): CollaborationSession;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:57
Returns
Inherited from
BaseProtocol.createSession
execute()
execute(config, agents): Promise<Result<CollaborationResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:108
Parameters
config
agents
Map<string, IAgent>
Returns
Promise<Result<CollaborationResult, AgentError>>
Overrides
BaseProtocol.execute
executeAgentTask()
protected executeAgentTask(
agent,
task,
previousResults?
): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:62
Parameters
agent
task
previousResults?
Returns
Promise<Result<TaskResult, AgentError>>
Inherited from
BaseProtocol.executeAgentTask
validateAgents()
protected validateAgents(config, agents): Result<void, AgentError>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:85
Parameters
config
agents
Map<string, IAgent>
Returns
Result<void, AgentError>
Inherited from
BaseProtocol.validateAgents
SimpleAgent
Defined in: packages/nexus-agents/src/agents/simple-agent.ts:17
Simple concrete agent implementation for testing and basic use cases.
This agent processes tasks by sending them directly to the model adapter and returning the response.
Extends
Extended by
Constructors
Constructor
new SimpleAgent(options): SimpleAgent;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:129
Parameters
options
Returns
Inherited from
Properties
adapter
protected adapter: IModelAdapter | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:98
Inherited from
budgetTracker
protected readonly budgetTracker: ITokenBudgetTracker;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:97
Inherited from
capabilities
readonly capabilities: readonly AgentCapability[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:95
Agent capabilities
Inherited from
config
protected config: AgentConfig | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:100
Inherited from
emitMessageEvents
protected readonly emitMessageEvents: boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:107
Inherited from
eventBus
protected readonly eventBus: ICollaborationEventBus;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:106
Inherited from
history
protected history: Message[] = [];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:102
Inherited from
id
readonly id: string;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:93
Unique agent identifier
Inherited from
logger
protected readonly logger: ILogger;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:99
Inherited from
maxTokens
protected readonly maxTokens: number;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:105
Inherited from
role
readonly role: AgentRole;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:94
Agent role
Inherited from
sharedState
protected sharedState: Record<string, unknown> = {};
Defined in: packages/nexus-agents/src/agents/base-agent.ts:101
Inherited from
stateMachine
protected readonly stateMachine: AgentStateMachine;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:96
Inherited from
systemPrompt
protected readonly systemPrompt: string | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:103
Inherited from
temperature
protected readonly temperature: number;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:104
Inherited from
Accessors
state
Get Signature
get state(): AgentState;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:176
Current state
Returns
Current state
Inherited from
Methods
addContextItem()
protected addContextItem(
content,
priority?,
category?
): Promise<void>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:344
Parameters
content
string
priority?
100 | 20 | 60 | 80 | 40
category?
"system" | "task" | "active"
Returns
Promise<void>
Inherited from
addToHistory()
protected addToHistory(message): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:331
Parameters
message
Returns
void
Inherited from
buildPrompt()
protected buildPrompt(task): Message[];
Defined in: packages/nexus-agents/src/agents/simple-agent.ts:105
Build prompt messages from a task.
Parameters
task
Returns
Message[]
Overrides
cleanup()
cleanup(): Promise<void>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:276
Cleanup agent resources.
Returns
Promise<void>
Inherited from
clearHistory()
protected clearHistory(): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:337
Returns
void
Inherited from
complete()
protected complete(request): Promise<Result<CompletionResponse, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:303
Parameters
request
Returns
Promise<Result<CompletionResponse, AgentError>>
Inherited from
execute()
execute(task, options?): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:218
Execute a task.
Parameters
task
Task to execute
options?
Optional execution options (#3016/#3040).
signal cancels the in-flight model call when the caller’s deadline
wins a race; without it, the SDK keeps running to its own 10-minute
timeout after the caller has already discarded the result.
signal?
AbortSignal
Returns
Promise<Result<TaskResult, AgentError>>
Result with TaskResult or AgentError
Inherited from
executeTask()
protected executeTask(task): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/simple-agent.ts:21
Execute a task by sending it to the model.
Parameters
task
Returns
Promise<Result<TaskResult, AgentError>>
Overrides
findResolutionForError()
protected findResolutionForError(errorMessage): ErrorResolution | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:393
Parameters
errorMessage
string
Returns
ErrorResolution | undefined
Inherited from
BaseAgent.findResolutionForError
flushMemory()
flushMemory(): Promise<Result<void, AgentMemoryError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:371
Returns
Promise<Result<void, AgentMemoryError>>
Inherited from
getHistory()
protected getHistory(): Message[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:334
Returns
Message[]
Inherited from
getMemoryState()
getMemoryState(): Readonly<AgentMemoryState> | null;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:364
Returns
Readonly<AgentMemoryState> | null
Inherited from
getPruningMetrics()
getPruningMetrics(): Readonly<ContextPruningMetrics>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:340
Returns
Readonly<ContextPruningMetrics>
Inherited from
getRelevantMemories()
getRelevantMemories(): readonly TypedMemoryEntry<MemoryType>[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:367
Returns
readonly TypedMemoryEntry<MemoryType>[]
Inherited from
getTaskLearnings()
protected getTaskLearnings(taskType): readonly TaskLearning[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:396
Parameters
taskType
string
Returns
readonly TaskLearning[]
Inherited from
handleMessage()
handleMessage(msg): Promise<Result<AgentResponse, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:261
Handle an inter-agent message and return a response.
Delivery semantics (#3222). This is a direct, awaited request/response
call: the caller invokes it and holds the returned promise. It is NOT a
queued or broadcast channel — that is the collaboration event bus
(agents/collaboration/event-bus.ts), a fire-and-forget pub/sub with its
own semantics. For this method specifically:
- Ordering is the caller’s responsibility. Sequential
awaits are handled in call order; concurrent calls carry no cross-message ordering guarantee. - Delivery is exactly the method invocation — there is no automatic
retry or redelivery. A returned
err(...)is the caller’s signal to decide whether to retry; the agent does not re-queue the message. - Errors surface as
Result.err, not as a throw for expected conditions; the caller branches on theResult.
Parameters
msg
Message to handle
Returns
Promise<Result<AgentResponse, AgentError>>
Result with AgentResponse, or AgentError on failure (not retried)
Inherited from
hasCapability()
hasCapability(capability): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:292
Parameters
capability
Returns
boolean
Inherited from
initialize()
initialize(ctx): Promise<Result<void, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:205
Initialize the agent with context.
Parameters
ctx
AgentContext
Agent context
Returns
Promise<Result<void, AgentError>>
Result with void or AgentError
Inherited from
isContextPruningEnabled()
isContextPruningEnabled(): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:358
Returns
boolean
Inherited from
BaseAgent.isContextPruningEnabled
isMemoryEnabled()
isMemoryEnabled(): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:361
Returns
boolean
Inherited from
recordLearning()
protected recordLearning(learning): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:384
Parameters
learning
Omit<TaskLearning, "id" | "learnedAt">
Returns
void
Inherited from
recordPattern()
protected recordPattern(p): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:387
Parameters
p
Omit<ExecutionPattern, "id" | "lastSeen" | "occurrences">
Returns
void
Inherited from
recordResolution()
protected recordResolution(r): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:390
Parameters
r
Omit<ErrorResolution, "resolvedAt">
Returns
void
Inherited from
transformError()
protected transformError(error, taskId): AgentError;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:299
Parameters
error
unknown
taskId
string
Returns
Inherited from
TestingExpert
Defined in: packages/nexus-agents/src/agents/experts/testing-expert.ts:60
TestingExpert - Expert agent for testing-related tasks.
Extends
Constructors
Constructor
new TestingExpert(options?): TestingExpert;
Defined in: packages/nexus-agents/src/agents/experts/testing-expert.ts:63
Parameters
options?
Partial<BaseAgentOptions> & {
expertOptions?: TestingExpertOptions;
} = {}
Returns
Overrides
Properties
adapter
protected adapter: IModelAdapter | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:98
Inherited from
budgetTracker
protected readonly budgetTracker: ITokenBudgetTracker;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:97
Inherited from
capabilities
readonly capabilities: readonly AgentCapability[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:95
Agent capabilities
Inherited from
config
protected config: AgentConfig | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:100
Inherited from
emitMessageEvents
protected readonly emitMessageEvents: boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:107
Inherited from
eventBus
protected readonly eventBus: ICollaborationEventBus;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:106
Inherited from
history
protected history: Message[] = [];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:102
Inherited from
id
readonly id: string;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:93
Unique agent identifier
Inherited from
logger
protected readonly logger: ILogger;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:99
Inherited from
maxTokens
protected readonly maxTokens: number;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:105
Inherited from
role
readonly role: AgentRole;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:94
Agent role
Inherited from
sharedState
protected sharedState: Record<string, unknown> = {};
Defined in: packages/nexus-agents/src/agents/base-agent.ts:101
Inherited from
stateMachine
protected readonly stateMachine: AgentStateMachine;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:96
Inherited from
systemPrompt
protected readonly systemPrompt: string | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:103
Inherited from
temperature
protected readonly temperature: number;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:104
Inherited from
Accessors
state
Get Signature
get state(): AgentState;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:176
Current state
Returns
Current state
Inherited from
Methods
addContextItem()
protected addContextItem(
content,
priority?,
category?
): Promise<void>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:344
Parameters
content
string
priority?
100 | 20 | 60 | 80 | 40
category?
"system" | "task" | "active"
Returns
Promise<void>
Inherited from
addToHistory()
protected addToHistory(message): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:331
Parameters
message
Returns
void
Inherited from
buildPrompt()
protected buildPrompt(task): Message[];
Defined in: packages/nexus-agents/src/agents/experts/testing-expert.ts:89
Parameters
task
Returns
Message[]
Overrides
cleanup()
cleanup(): Promise<void>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:276
Cleanup agent resources.
Returns
Promise<void>
Inherited from
clearHistory()
protected clearHistory(): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:337
Returns
void
Inherited from
complete()
protected complete(request): Promise<Result<CompletionResponse, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:303
Parameters
request
Returns
Promise<Result<CompletionResponse, AgentError>>
Inherited from
execute()
execute(task, options?): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:218
Execute a task.
Parameters
task
Task to execute
options?
Optional execution options (#3016/#3040).
signal cancels the in-flight model call when the caller’s deadline
wins a race; without it, the SDK keeps running to its own 10-minute
timeout after the caller has already discarded the result.
signal?
AbortSignal
Returns
Promise<Result<TaskResult, AgentError>>
Result with TaskResult or AgentError
Inherited from
executeTask()
protected executeTask(task): Promise<Result<TaskResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/experts/testing-expert.ts:71
Parameters
task
Returns
Promise<Result<TaskResult, AgentError>>
Overrides
findResolutionForError()
protected findResolutionForError(errorMessage): ErrorResolution | undefined;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:393
Parameters
errorMessage
string
Returns
ErrorResolution | undefined
Inherited from
BaseAgent.findResolutionForError
flushMemory()
flushMemory(): Promise<Result<void, AgentMemoryError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:371
Returns
Promise<Result<void, AgentMemoryError>>
Inherited from
getExpertOptions()
getExpertOptions(): Readonly<TestingExpertOptions>;
Defined in: packages/nexus-agents/src/agents/experts/testing-expert.ts:105
Returns
Readonly<TestingExpertOptions>
getHistory()
protected getHistory(): Message[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:334
Returns
Message[]
Inherited from
getMemoryState()
getMemoryState(): Readonly<AgentMemoryState> | null;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:364
Returns
Readonly<AgentMemoryState> | null
Inherited from
getPruningMetrics()
getPruningMetrics(): Readonly<ContextPruningMetrics>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:340
Returns
Readonly<ContextPruningMetrics>
Inherited from
getRelevantMemories()
getRelevantMemories(): readonly TypedMemoryEntry<MemoryType>[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:367
Returns
readonly TypedMemoryEntry<MemoryType>[]
Inherited from
getTaskLearnings()
protected getTaskLearnings(taskType): readonly TaskLearning[];
Defined in: packages/nexus-agents/src/agents/base-agent.ts:396
Parameters
taskType
string
Returns
readonly TaskLearning[]
Inherited from
handleMessage()
handleMessage(msg): Promise<Result<AgentResponse, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:261
Handle an inter-agent message and return a response.
Delivery semantics (#3222). This is a direct, awaited request/response
call: the caller invokes it and holds the returned promise. It is NOT a
queued or broadcast channel — that is the collaboration event bus
(agents/collaboration/event-bus.ts), a fire-and-forget pub/sub with its
own semantics. For this method specifically:
- Ordering is the caller’s responsibility. Sequential
awaits are handled in call order; concurrent calls carry no cross-message ordering guarantee. - Delivery is exactly the method invocation — there is no automatic
retry or redelivery. A returned
err(...)is the caller’s signal to decide whether to retry; the agent does not re-queue the message. - Errors surface as
Result.err, not as a throw for expected conditions; the caller branches on theResult.
Parameters
msg
Message to handle
Returns
Promise<Result<AgentResponse, AgentError>>
Result with AgentResponse, or AgentError on failure (not retried)
Inherited from
hasCapability()
hasCapability(capability): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:292
Parameters
capability
Returns
boolean
Inherited from
initialize()
initialize(ctx): Promise<Result<void, AgentError>>;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:205
Initialize the agent with context.
Parameters
ctx
AgentContext
Agent context
Returns
Promise<Result<void, AgentError>>
Result with void or AgentError
Inherited from
isContextPruningEnabled()
isContextPruningEnabled(): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:358
Returns
boolean
Inherited from
BaseAgent.isContextPruningEnabled
isMemoryEnabled()
isMemoryEnabled(): boolean;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:361
Returns
boolean
Inherited from
recordLearning()
protected recordLearning(learning): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:384
Parameters
learning
Omit<TaskLearning, "id" | "learnedAt">
Returns
void
Inherited from
recordPattern()
protected recordPattern(p): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:387
Parameters
p
Omit<ExecutionPattern, "id" | "lastSeen" | "occurrences">
Returns
void
Inherited from
recordResolution()
protected recordResolution(r): void;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:390
Parameters
r
Omit<ErrorResolution, "resolvedAt">
Returns
void
Inherited from
transformError()
protected transformError(error, taskId): AgentError;
Defined in: packages/nexus-agents/src/agents/base-agent.ts:299
Parameters
error
unknown
taskId
string
Returns
Inherited from
TrinityCoordinator
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-coordinator.ts:60
Coordinates Thinker, Worker, and Verifier roles for task execution.
Constructors
Constructor
new TrinityCoordinator(options?): TrinityCoordinator;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-coordinator.ts:67
Parameters
options?
TrinityConfig | TrinityCoordinatorOptions
Returns
Methods
cancel()
cancel(reason): void;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-coordinator.ts:86
Parameters
reason
string
Returns
void
execute()
execute(options): Promise<Result<TrinityResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-coordinator.ts:91
Parameters
options
Returns
Promise<Result<TrinityResult, AgentError>>
WaveScheduler
Defined in: packages/nexus-agents/src/agents/wave-scheduler.ts:60
Wave scheduler for bounded parallel task execution.
Executes tasks in waves respecting concurrency limits, dependency order, output budgets, and token budgets. Each wave waits for all tasks to complete before the next wave launches.
Example
const scheduler = createWaveScheduler({ maxConcurrency: 3 });
const result = await scheduler.execute(tasks, async (task) => {
return await runAgent(task.input);
});
console.log(`Completed in ${result.waves.length} waves`);
Constructors
Constructor
new WaveScheduler(config?, logger?): WaveScheduler;
Defined in: packages/nexus-agents/src/agents/wave-scheduler.ts:64
Parameters
config?
Partial<WaveSchedulerConfig> = {}
logger?
Returns
Methods
buildWaves()
buildWaves<T>(tasks): WaveTask<T>[][];
Defined in: packages/nexus-agents/src/agents/wave-scheduler.ts:116
Build waves from tasks respecting dependency ordering.
Tasks with no unresolved dependencies go in the earliest possible wave. Within each wave, tasks are further split into sub-waves of maxConcurrency size.
Type Parameters
T
T
Parameters
tasks
readonly WaveTask<T>[]
Returns
WaveTask<T>[][]
execute()
execute<T>(tasks, executor): Promise<WaveExecutionResult>;
Defined in: packages/nexus-agents/src/agents/wave-scheduler.ts:72
Execute tasks in waves respecting dependencies and concurrency limits.
Type Parameters
T
T
Parameters
tasks
readonly WaveTask<T>[]
executor
Returns
Promise<WaveExecutionResult>
getConfig()
getConfig(): Readonly<WaveSchedulerConfig>;
Defined in: packages/nexus-agents/src/agents/wave-scheduler.ts:157
Get the scheduler configuration.
Returns
Readonly<WaveSchedulerConfig>
Interfaces
ActivationOptions
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:190
Options for sparse activation selection.
Properties
ensureTreeCoverage
readonly ensureTreeCoverage: boolean;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:198
Ensure at least one node per active tree
maxActive
readonly maxActive: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:192
Maximum nodes to activate
minScore
readonly minScore: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:196
Minimum score to consider for activation
strategy
readonly strategy: ActivationStrategy;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:194
Strategy for selection
AgenticAdapterOptions
Defined in: packages/nexus-agents/src/agents/agentic/agentic-adapter.ts:61
Agents exports - Agent framework, Orchestrator, Experts Split from index.ts for file size compliance (Issue #285)
Properties
forceProfile?
readonly optional forceProfile?: ModelEntry;
Defined in: packages/nexus-agents/src/agents/agentic/agentic-adapter.ts:86
Force a specific behaviour profile, bypassing identity-driven
lookup entirely. Reserved for tests + diagnostic runs; in
production prefer modelHints so identity stays auditable.
maxConcurrent?
readonly optional maxConcurrent?: number;
Defined in: packages/nexus-agents/src/agents/agentic/agentic-adapter.ts:67
Maximum number of concurrent model API calls across all in-flight
runAgent() calls. Default unlimited. Set this when the upstream
provider rate-limits aggressively.
modelHints?
readonly optional modelHints?: ModelHints;
Defined in: packages/nexus-agents/src/agents/agentic/agentic-adapter.ts:74
Per-model identity overrides — gateway-renamed models, custom deployments, or anything the modelId-string parser can’t classify. Each field is optional; provided fields force, others fall through to probe / parse.
registry?
readonly optional registry?: ModelRegistry;
Defined in: packages/nexus-agents/src/agents/agentic/agentic-adapter.ts:92
Override the registry used for getEntry lookups. Defaults to
the lazy global registry. Tests and multi-tenant deployments
inject their own.
skipProbe?
readonly optional skipProbe?: boolean;
Defined in: packages/nexus-agents/src/agents/agentic/agentic-adapter.ts:80
Skip the IModelAdapter.listModels() probe at first runAgent.
Useful when the gateway doesn’t expose /v1/models or when
deterministic startup matters more than identity fidelity.
AgenticToolCall
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:23
Tool call emitted by the model.
Mirrors the Anthropic Messages API tool_use ContentBlock shape;
the wrapper translates whatever the underlying provider produces
into this canonical form so harnesses don’t care which provider
they’re talking to.
Properties
arguments
readonly arguments: Record<string, unknown>;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:29
Arguments — already JSON-parsed; provider-side is responsible for parsing.
id
readonly id: string;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:25
Unique id for this tool call, threaded back through tool_use_id.
name
readonly name: string;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:27
Tool name (must match a ToolDefinition.name from the input).
AgenticToolResult
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:41
Result of a tool call, returned by the harness’s onToolCall.
content is whatever string representation of the result the model
should see next turn. Convention: stringify objects, prefer one-line
for primitives. isError tells the model the call failed (Anthropic
surfaces this as is_error: true in the next turn’s tool_result
block; other providers handle similarly).
Properties
content
readonly content: string;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:42
isError?
readonly optional isError?: boolean;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:43
AgentRunResult
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:81
Final result of a successful runAgent call.
stopReason: 'agent-stopped' | 'turn-budget' | 'tool-error' | 'cancelled'
is reported via the result, NOT via Result.err — partial-progress
runs are gradable, and the harness inspects turns to decide.
Properties
adapterStrategy
readonly adapterStrategy: string;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:104
Strategy used to drive the loop. native:<providerId> when the
underlying adapter is a known provider whose tool-use API is being
threaded through; wrapper for unknown providers / custom adapters
where the loop relies only on the IModelAdapter contract surface.
Eval harnesses record this so cross-provider runs are auditable.
finalContent
readonly finalContent: string;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:110
The model’s final assistant content (the response after the last
tool result, when the model emits no further tool call). Empty
string when the loop ended on turn-budget or cancelled.
modelId
readonly modelId: string;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:95
Model-id stamp from the underlying IModelAdapter.
providerId
readonly providerId: string;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:93
Provider-id stamp from the underlying IModelAdapter — operators
read this when comparing eval results across providers, since
tool-use fidelity is provider-dependent.
stopReason
readonly stopReason: AgentStopReason;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:83
totalInputTokens?
readonly optional totalInputTokens?: number;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:86
Aggregated token usage across all turns (sum of per-turn inputs/outputs).
totalOutputTokens?
readonly optional totalOutputTokens?: number;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:87
turns
readonly turns: readonly AgentTurn[];
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:84
turnsUsed
readonly turnsUsed: number;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:82
AgentTurn
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:50
One turn of the agent loop — model emits a tool call, harness resolves it, harness records the trace.
Properties
inputTokens?
readonly optional inputTokens?: number;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:59
Provider-reported input tokens for this turn’s API call (when available).
modelLatencyMs
readonly modelLatencyMs: number;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:55
Wall-clock time spent in the model API call that produced the tool call.
outputTokens?
readonly optional outputTokens?: number;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:61
Provider-reported output tokens for this turn’s API call (when available).
toolCall
readonly toolCall: AgenticToolCall;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:52
toolLatencyMs
readonly toolLatencyMs: number;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:57
Wall-clock time spent waiting for onToolCall to resolve.
toolResult
readonly toolResult: AgenticToolResult;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:53
turnIndex
readonly turnIndex: number;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:51
AggregatedResult
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:228
Aggregated result from multiple experts.
Properties
conflicts
conflicts: ResultConflict[];
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:232
metadata
metadata: AggregationMetadata;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:233
output
output: unknown;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:229
qualityScore
qualityScore: number;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:231
strategy
strategy: "merge" | "consensus" | "select_best" | "sequential_chain";
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:230
AggregationMetadata
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:251
Metadata about the aggregation process.
Properties
aggregatedAt
aggregatedAt: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:294
averageConfidence
averageConfidence: number;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:254
confidenceMeasured?
optional confidenceMeasured?: boolean;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:279
Whether averageConfidence is a measurement (#4831).
false means no contributor carried a confidence signal, so
averageConfidence is a placeholder 0 and NOT a score — a session whose
confidence was never assessed must not read as a confident one. The
collaboration-session builder is in that position: TaskResult has no
confidence field, while the ResultAggregator path computes the value
from ExpertResult.confidence.
Absent means the producer predates the distinction — unknown, not
measured. Mirrors ResultMetadata.tokensMeasured (#4734).
conflictCount
conflictCount: number;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:253
conflictsDetected?
optional conflictsDetected?: boolean;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:293
Whether conflicts is the outcome of a comparison (#4854).
false means nothing was compared, so an empty conflicts list and a
conflictCount of 0 are the absence of a check — not the absence of
disagreement. They are byte-identical to what a genuinely unanimous
session produces, which is exactly why the distinction has to be stated
rather than inferred. The collaboration-session builder is in that
position; the ResultAggregator path compares fields pairwise.
Absent means the producer predates the distinction — unknown, not
checked. Mirrors confidenceMeasured (#4831).
resultCount
resultCount: number;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:252
totalTokensUsed
totalTokensUsed: number;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:255
unmeasuredResults?
optional unmeasuredResults?: number;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:265
How many contributors reported no measured usage (#4743).
totalTokensUsed sums what was measured. A contributor whose adapter
reported nothing carries a placeholder 0 (ResultMetadata.tokensMeasured === false), so without this count the total reads as complete when it is a
LOWER BOUND. Absent means the aggregate predates the distinction — unknown,
not zero.
AggregatorInput
Defined in: packages/nexus-agents/src/agents/collaboration/aggregator-types.ts:48
Input for aggregation.
Properties
pattern
pattern: CollaborationPattern;
Defined in: packages/nexus-agents/src/agents/collaboration/aggregator-types.ts:49
results
results: ExpertResult[];
Defined in: packages/nexus-agents/src/agents/collaboration/aggregator-types.ts:50
reviews?
optional reviews?: ReviewResponseMessage[];
Defined in: packages/nexus-agents/src/agents/collaboration/aggregator-types.ts:52
votes?
optional votes?: VoteMessage[];
Defined in: packages/nexus-agents/src/agents/collaboration/aggregator-types.ts:51
AggregatorOptions
Defined in: packages/nexus-agents/src/agents/collaboration/result-aggregator.ts:46
Options for result aggregation.
Properties
conflictResolver?
optional conflictResolver?: ConflictResolver;
Defined in: packages/nexus-agents/src/agents/collaboration/result-aggregator.ts:48
logger?
optional logger?: ILogger;
Defined in: packages/nexus-agents/src/agents/collaboration/result-aggregator.ts:47
minQualityScore?
optional minQualityScore?: number;
Defined in: packages/nexus-agents/src/agents/collaboration/result-aggregator.ts:50
qualityScorer?
optional qualityScorer?: QualityScorer;
Defined in: packages/nexus-agents/src/agents/collaboration/result-aggregator.ts:49
ApiDocumentation
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:37
API documentation structure.
Properties
endpoints
endpoints: ApiEndpoint[];
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:39
API endpoints or functions
types
types: ApiType[];
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:41
Data types
ApiEndpoint
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:47
API endpoint documentation.
Properties
description
description: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:51
Description
example?
optional example?: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:62
Example usage
name
name: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:49
Endpoint name
parameters
parameters: {
description: string;
name: string;
required: boolean;
type: string;
}[];
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:53
Parameters
description
description: string;
name
name: string;
required
required: boolean;
type
type: string;
returns
returns: {
description: string;
type: string;
};
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:60
Return type
description
description: string;
type
type: string;
ApiType
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:68
API type documentation.
Properties
description
description: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:72
Description
name
name: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:70
Type name
properties
properties: {
description: string;
name: string;
optional: boolean;
type: string;
}[];
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:74
Properties
description
description: string;
name
name: string;
optional
optional: boolean;
type
type: string;
ArchitectureAnalysisResult
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:117
Architecture analysis result from ArchitectureExpert.
Extends
Properties
analysisType
analysisType: "review" | "design" | "pattern_selection";
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:119
Analysis type
components?
optional components?: SystemComponent[];
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:125
System components
confidence
confidence: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:42
Confidence score (0-1)
Inherited from
content
content: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:34
Primary result content
Inherited from
decisions?
optional decisions?: ArchitectureDecision[];
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:123
Design decisions
modelUsed?
optional modelUsed?: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:44
Model used for this expert’s execution (Issue #817)
Inherited from
patterns?
optional patterns?: ArchitecturePattern[];
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:121
Identified patterns
recommendations?
optional recommendations?: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:38
Recommendations or suggestions
Inherited from
structuredData?
optional structuredData?: Record<string, unknown>;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:36
Structured data if applicable
Inherited from
warnings?
optional warnings?: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:40
Warnings or issues found
Inherited from
ArchitectureDecision
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:145
Architecture decision record.
Properties
consequences
consequences: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:155
Consequences
context
context: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:151
Context
decision
decision: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:153
Decision made
id
id: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:147
Decision ID
status
status: "deprecated" | "superseded" | "accepted" | "proposed";
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:157
Status
title
title: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:149
Decision title
ArchitectureExpertOptions
Defined in: packages/nexus-agents/src/agents/experts/architecture-expert.ts:38
Configuration options for ArchitectureExpert.
Extends
Properties
additionalCapabilities?
optional additionalCapabilities?: AgentCapability[];
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:26
Custom capability extensions
Inherited from
ExpertOptions.additionalCapabilities
enableHeuristics?
optional enableHeuristics?: boolean;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:24
Enable domain-specific heuristics
Inherited from
ExpertOptions.enableHeuristics
generateADRs?
optional generateADRs?: boolean;
Defined in: packages/nexus-agents/src/agents/experts/architecture-expert.ts:42
Generate ADRs automatically
includeC4Suggestions?
optional includeC4Suggestions?: boolean;
Defined in: packages/nexus-agents/src/agents/experts/architecture-expert.ts:44
Include C4 diagram suggestions
maxTokens?
optional maxTokens?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:22
Maximum tokens for responses
Inherited from
preferredStyles?
optional preferredStyles?: ArchitectureStyle[];
Defined in: packages/nexus-agents/src/agents/experts/architecture-expert.ts:40
Preferred architecture styles
qualityPriorities?
optional qualityPriorities?: QualityAttribute[];
Defined in: packages/nexus-agents/src/agents/experts/architecture-expert.ts:46
Quality attributes to prioritize
systemPromptOverride?
optional systemPromptOverride?: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:18
Custom system prompt override
Inherited from
ExpertOptions.systemPromptOverride
temperature?
optional temperature?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:20
Temperature for completions (domain-specific default if not set)
Inherited from
ArchitecturePattern
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:131
Architecture pattern identification.
Properties
applicability
applicability: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:137
Applicability score (0-1)
category
category: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:135
Pattern category
name
name: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:133
Pattern name
tradeoffs
tradeoffs: {
cons: string[];
pros: string[];
};
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:139
Trade-offs
cons
cons: string[];
pros
pros: string[];
BaseAgentOptions
Defined in: packages/nexus-agents/src/agents/base-agent-types.ts:17
Options for creating a BaseAgent.
Properties
adapter?
optional adapter?: IModelAdapter;
Defined in: packages/nexus-agents/src/agents/base-agent-types.ts:25
Model adapter for LLM interactions
capabilities
capabilities: readonly AgentCapability[];
Defined in: packages/nexus-agents/src/agents/base-agent-types.ts:23
Agent capabilities
contextPruning?
optional contextPruning?: ContextPrunerAgentConfig;
Defined in: packages/nexus-agents/src/agents/base-agent-types.ts:43
Configuration for automatic context pruning (Issue #306)
emitMessageEvents?
optional emitMessageEvents?: boolean;
Defined in: packages/nexus-agents/src/agents/base-agent-types.ts:37
Whether to emit events for message handling (default: true)
eventBus?
optional eventBus?: ICollaborationEventBus;
Defined in: packages/nexus-agents/src/agents/base-agent-types.ts:35
Event bus for message observability (uses global bus if not provided)
id
id: string;
Defined in: packages/nexus-agents/src/agents/base-agent-types.ts:19
Unique agent identifier
logger?
optional logger?: ILogger;
Defined in: packages/nexus-agents/src/agents/base-agent-types.ts:27
Custom logger instance
maxTokens?
optional maxTokens?: number;
Defined in: packages/nexus-agents/src/agents/base-agent-types.ts:33
Maximum tokens for responses
memory?
optional memory?: AgentMemoryConfig;
Defined in: packages/nexus-agents/src/agents/base-agent-types.ts:45
Configuration for memory backend integration (Issue #348)
role
role: AgentRole;
Defined in: packages/nexus-agents/src/agents/base-agent-types.ts:21
Agent role
stateMachineOptions?
optional stateMachineOptions?: StateMachineOptions;
Defined in: packages/nexus-agents/src/agents/base-agent-types.ts:39
State machine options for validated state transitions
systemPrompt?
optional systemPrompt?: string;
Defined in: packages/nexus-agents/src/agents/base-agent-types.ts:29
System prompt for the agent
temperature?
optional temperature?: number;
Defined in: packages/nexus-agents/src/agents/base-agent-types.ts:31
Default temperature for completions
tokenBudget?
optional tokenBudget?: TokenBudgetConfig;
Defined in: packages/nexus-agents/src/agents/base-agent-types.ts:41
Token budget configuration for EMA-based tracking (Issue #304)
BestSolution
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:55
The best solution found by the forest.
Properties
combinedScore
readonly combinedScore: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:67
Combined score
conclusionNode
readonly conclusionNode: ReasoningNode;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:61
Solution node
confidence
readonly confidence: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:63
Overall confidence
path
readonly path: readonly string[];
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:59
Path to the solution
qualityScore
readonly qualityScore: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:65
Overall quality score
treeId
readonly treeId: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:57
Tree that produced the solution
CodeAnalysisResult
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:33
Code analysis result from CodeExpert.
Extends
Properties
affectedFiles?
optional affectedFiles?: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:37
Files affected
codeChanges?
optional codeChanges?: CodeChange[];
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:39
Code changes or suggestions
confidence
confidence: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:42
Confidence score (0-1)
Inherited from
content
content: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:34
Primary result content
Inherited from
modelUsed?
optional modelUsed?: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:44
Model used for this expert’s execution (Issue #817)
Inherited from
operationType
operationType: "generation" | "debugging" | "optimization" | "refactoring";
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:35
Type of code operation performed
recommendations?
optional recommendations?: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:38
Recommendations or suggestions
Inherited from
structuredData?
optional structuredData?: Record<string, unknown>;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:36
Structured data if applicable
Inherited from
warnings?
optional warnings?: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:40
Warnings or issues found
Inherited from
CodeChange
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:45
Represents a single code change.
Properties
description
description: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:55
Description of change
file
file: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:47
File path
lineRange?
optional lineRange?: {
end: number;
start: number;
};
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:49
Line number or range
end
end: number;
start
start: number;
modified
modified: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:53
Modified code
original?
optional original?: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:51
Original code
CodeExpertOptions
Defined in: packages/nexus-agents/src/agents/experts/code-expert-helpers.ts:15
Configuration options for CodeExpert.
Extends
Properties
additionalCapabilities?
optional additionalCapabilities?: AgentCapability[];
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:26
Custom capability extensions
Inherited from
ExpertOptions.additionalCapabilities
codeStyle?
optional codeStyle?: "mixed" | "functional" | "object-oriented";
Defined in: packages/nexus-agents/src/agents/experts/code-expert-helpers.ts:19
Preferred code style (if applicable)
enableHeuristics?
optional enableHeuristics?: boolean;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:24
Enable domain-specific heuristics
Inherited from
ExpertOptions.enableHeuristics
maxTokens?
optional maxTokens?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:22
Maximum tokens for responses
Inherited from
strictTypes?
optional strictTypes?: boolean;
Defined in: packages/nexus-agents/src/agents/experts/code-expert-helpers.ts:17
Enable strict type checking recommendations
systemPromptOverride?
optional systemPromptOverride?: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:18
Custom system prompt override
Inherited from
ExpertOptions.systemPromptOverride
targetLanguage?
optional targetLanguage?: string;
Defined in: packages/nexus-agents/src/agents/experts/code-expert-helpers.ts:21
Target language for code generation
temperature?
optional temperature?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:20
Temperature for completions (domain-specific default if not set)
Inherited from
CollaborationConfig
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:67
Configuration for a collaboration session.
Properties
experts
experts: string[];
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:70
maxRetries?
optional maxRetries?: number;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:75
minVotes?
optional minVotes?: number;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:73
pattern
pattern: CollaborationPattern;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:69
requireUnanimous?
optional requireUnanimous?: boolean;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:74
sessionId
sessionId: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:68
task
task: Task;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:71
timeout?
optional timeout?: number;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:72
CollaborationResult
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:202
Final collaboration result.
Properties
aggregatedResult
aggregatedResult: AggregatedResult;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:205
durationMs
durationMs: number;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:207
error?
optional error?: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:209
expertResults
expertResults: ExpertResultSummary[];
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:206
pattern
pattern: CollaborationPattern;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:204
sessionId
sessionId: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:203
success
success: boolean;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:208
CollaborationSessionOptions
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session-helpers.ts:19
Options for creating a CollaborationSession.
Properties
eventBus?
optional eventBus?: ICollaborationEventBus;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session-helpers.ts:25
Optional event bus for cross-session event publishing
logger?
optional logger?: ILogger;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session-helpers.ts:20
onMessage?
optional onMessage?: (message) => void;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session-helpers.ts:22
Parameters
message
Returns
void
onStatusChange?
optional onStatusChange?: (status) => void;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session-helpers.ts:21
Parameters
status
Returns
void
roleResolver?
optional roleResolver?: (expertId) => AgentRole;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session-helpers.ts:23
Parameters
expertId
string
Returns
ComplianceStatus
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:105
Compliance check status.
Properties
findings
findings: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:111
Specific findings
framework
framework: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:107
Compliance framework
status
status: "partial" | "compliant" | "non-compliant";
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:109
Overall status
Conflict
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:160
Conflict between results.
Properties
description
description: string;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:166
Description of the conflict
resolution
resolution: string;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:168
How the conflict was resolved
subtaskId1
subtaskId1: string;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:162
First subtask ID
subtaskId2
subtaskId2: string;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:164
Second subtask ID
ContextBudget
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:32
Budget allocation for context categories. Based on PROJECT_PLAN.md recommendations.
Properties
active
active: number;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:38
Active working content (default: 50%)
reserved
reserved: number;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:40
Reserved for response generation (default: 15%)
system
system: number;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:34
System instructions and project context (default: 15%)
task
task: number;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:36
Current task description and requirements (default: 20%)
ContextItem
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:70
A piece of content in the context with its metadata.
Properties
addedAt
addedAt: number;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:82
When this item was added
category
category: "system" | "task" | "active";
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:78
Budget category this item belongs to
content
content: string;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:74
The content (message, text, etc.)
id
id: string;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:72
Unique identifier for this item
metadata?
optional metadata?: Record<string, unknown>;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:84
Optional metadata
priority
priority: ContentPriority;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:76
Priority level for retention
tokenCount
tokenCount: number;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:80
Token count for this item
ContextManagerConfig
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:95
Configuration for ContextManager.
Properties
adapter?
optional adapter?: IModelAdapter;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:101
Model adapter for token counting
budget?
optional budget?: ContextBudget;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:99
Budget allocation (defaults to DEFAULT_BUDGET)
logger?
optional logger?: ILogger;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:103
Custom logger
maxTokens
maxTokens: number;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:97
Maximum context window size in tokens
warningThreshold?
optional warningThreshold?: number;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:105
Warning threshold (0-1) - warn when this % of budget is used
ContextPrunerConfig
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:54
Configuration for ContextPruner.
Properties
adapter?
optional adapter?: IModelAdapter;
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:56
autoTriggerThreshold?
optional autoTriggerThreshold?: number;
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:61
contextManager
contextManager: ContextManager;
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:55
defaultStrategy?
optional defaultStrategy?: PruningStrategy;
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:58
logger?
optional logger?: ILogger;
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:57
minItemsPerCategory?
optional minItemsPerCategory?: number;
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:59
protectedPriority?
optional protectedPriority?: ContentPriority;
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:60
ContextStats
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:120
Statistics about context usage.
Properties
availableTokens
availableTokens: number;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:128
Available tokens (total - reserved)
categoryTokens
categoryTokens: Record<ContextItemCategory, number>;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:124
Tokens used per category
isOverBudget
isOverBudget: boolean;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:130
Whether any category is over budget
itemCounts
itemCounts: Record<ContextItemCategory, number>;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:126
Number of items per category
overBudgetCategories
overBudgetCategories: ("system" | "task" | "active")[];
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:132
Categories that are over budget
totalTokens
totalTokens: number;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:122
Total tokens currently used
usagePercentage
usagePercentage: number;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:134
Percentage of total capacity used
CoverageMetrics
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:207
Code coverage metrics.
Properties
branch
branch: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:211
Branch coverage percentage
function
function: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:213
Function coverage percentage
line
line: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:209
Line coverage percentage
statement
statement: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:215
Statement coverage percentage
uncoveredAreas?
optional uncoveredAreas?: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:217
Uncovered areas
CreateExpertOptions
Defined in: packages/nexus-agents/src/agents/experts/expert-factory.ts:48
Options for creating an expert. (Source: Issue #476 - Wire context pruning to ExpertFactory)
Properties
adapter?
optional adapter?: IModelAdapter;
Defined in: packages/nexus-agents/src/agents/experts/expert-factory.ts:50
Model adapter to use
additionalCapabilities?
optional additionalCapabilities?: AgentCapability[];
Defined in: packages/nexus-agents/src/agents/experts/expert-factory.ts:54
Additional capabilities to add
contextPruning?
optional contextPruning?: ContextPrunerAgentConfig;
Defined in: packages/nexus-agents/src/agents/experts/expert-factory.ts:60
Context pruning configuration (Issue #476). Enables automatic memory management for long-running conversations. Since Issue #479, context pruning is enabled by default.
modelOverrides?
optional modelOverrides?: Partial<ModelPreference>;
Defined in: packages/nexus-agents/src/agents/experts/expert-factory.ts:52
Override model preferences from config
recoveryPolicy?
optional recoveryPolicy?: ExpertRecoveryPolicy;
Defined in: packages/nexus-agents/src/agents/experts/expert-factory.ts:70
Opt-in transient-vs-permanent execution recovery policy (#4286).
When present, createExpert returns a RecoverableExpert whose
execute() retries transient failures (transport 429/5xx/network errors,
and archetype failures classified as recoverable) with exponential backoff,
and fails closed on permanent failures. When ABSENT, a plain Expert
is constructed and behavior is bit-for-bit identical to the pre-#4286 path.
CreateForestInput
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:167
Input for creating a new forest.
Properties
config?
readonly optional config?: Partial<ForestConfig>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:171
Initial configuration
initialHypotheses?
readonly optional initialHypotheses?: readonly string[];
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:173
Initial tree hypotheses to explore
problem
readonly problem: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:169
Problem to solve
CreateNodeInput
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:181
Input for creating a new reasoning node.
Properties
confidence
readonly confidence: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:191
Initial confidence (0-1)
content
readonly content: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:189
Content of the reasoning step
metadata?
readonly optional metadata?: Partial<ReasoningNodeMetadata>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:193
Optional metadata
parentId
readonly parentId: string | null;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:183
Parent node ID (null for root)
stepType
readonly stepType: ReasoningStepType;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:187
Type of reasoning step
treeId
readonly treeId: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:185
Tree ID this node belongs to
CreateTreeInput
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:221
Input for creating a new reasoning tree.
Properties
explorationPriority?
readonly optional explorationPriority?: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:227
Initial exploration priority
forestId
readonly forestId: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:223
Forest ID this tree belongs to
hypothesis
readonly hypothesis: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:225
Tree hypothesis or approach
CrossTreeInfo
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:107
Information shared across trees for cross-pollination.
Properties
failurePatterns
readonly failurePatterns: readonly FailurePattern[];
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:113
Patterns that have been proven ineffective
sharedConclusions
readonly sharedConclusions: readonly SharedConclusion[];
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:109
High-confidence conclusions found in other trees
sharedInsights
readonly sharedInsights: readonly SharedInsight[];
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:111
Useful intermediate results from other trees
DocumentationExpertOptions
Defined in: packages/nexus-agents/src/agents/experts/documentation-expert.ts:36
Configuration options for DocumentationExpert.
Extends
Properties
additionalCapabilities?
optional additionalCapabilities?: AgentCapability[];
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:26
Custom capability extensions
Inherited from
ExpertOptions.additionalCapabilities
audienceLevel?
optional audienceLevel?: "advanced" | "beginner" | "intermediate";
Defined in: packages/nexus-agents/src/agents/experts/documentation-expert.ts:42
Target audience level
enableHeuristics?
optional enableHeuristics?: boolean;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:24
Enable domain-specific heuristics
Inherited from
ExpertOptions.enableHeuristics
format?
optional format?: "jsdoc" | "markdown" | "tsdoc" | "rst";
Defined in: packages/nexus-agents/src/agents/experts/documentation-expert.ts:38
Documentation format
generateTOC?
optional generateTOC?: boolean;
Defined in: packages/nexus-agents/src/agents/experts/documentation-expert.ts:44
Generate table of contents
includeBadges?
optional includeBadges?: boolean;
Defined in: packages/nexus-agents/src/agents/experts/documentation-expert.ts:46
Include badges in README
includeExamples?
optional includeExamples?: boolean;
Defined in: packages/nexus-agents/src/agents/experts/documentation-expert.ts:40
Include code examples
maxTokens?
optional maxTokens?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:22
Maximum tokens for responses
Inherited from
systemPromptOverride?
optional systemPromptOverride?: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:18
Custom system prompt override
Inherited from
ExpertOptions.systemPromptOverride
temperature?
optional temperature?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:20
Temperature for completions (domain-specific default if not set)
Inherited from
DocumentationResult
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:13
Documentation result from DocumentationExpert.
Extends
Properties
apiDocs?
optional apiDocs?: ApiDocumentation;
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:19
API documentation
confidence
confidence: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:42
Confidence score (0-1)
Inherited from
content
content: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:34
Primary result content
Inherited from
documentationType
documentationType: "api" | "readme" | "guide" | "reference";
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:15
Documentation type
modelUsed?
optional modelUsed?: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:44
Model used for this expert’s execution (Issue #817)
Inherited from
recommendations?
optional recommendations?: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:38
Recommendations or suggestions
Inherited from
sections?
optional sections?: DocumentationSection[];
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:17
Generated documentation sections
structuredData?
optional structuredData?: Record<string, unknown>;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:36
Structured data if applicable
Inherited from
warnings?
optional warnings?: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:40
Warnings or issues found
Inherited from
DocumentationSection
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:25
Documentation section.
Properties
content
content: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:29
Section content
subsections?
optional subsections?: DocumentationSection[];
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:31
Subsections
title
title: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-documentation-types.ts:27
Section title
ExecutionPlan
Defined in: packages/nexus-agents/src/agents/tech-lead.ts:140
Execution plan output structure.
The ExecutionPlan represents the Orchestrator’s analysis and decomposition of a task. It can optionally be converted to a WorkflowDefinition for replayable, static execution via the WorkflowEngine.
ExecutionPlan extends ExecutionPlanData (the pure data) with the asWorkflowDefinition conversion method.
See
ARCHITECTURE.md for the separation of concerns between Orchestrator and WorkflowEngine
Extends
ExecutionPlanData
Properties
analysis
analysis: TaskAnalysis;
Defined in: packages/nexus-agents/src/agents/plan-converter.ts:27
Analysis of the task complexity and requirements
Inherited from
ExecutionPlanData.analysis
assignments
assignments: ExpertAssignment[];
Defined in: packages/nexus-agents/src/agents/plan-converter.ts:31
Expert role assignments for each subtask
Inherited from
ExecutionPlanData.assignments
estimatedDuration
estimatedDuration: number;
Defined in: packages/nexus-agents/src/agents/plan-converter.ts:35
Estimated total duration in milliseconds
Inherited from
ExecutionPlanData.estimatedDuration
parallelGroups
parallelGroups: string[][];
Defined in: packages/nexus-agents/src/agents/plan-converter.ts:33
Groups of subtask IDs that can execute in parallel
Inherited from
ExecutionPlanData.parallelGroups
subtasks
subtasks: SubTask[];
Defined in: packages/nexus-agents/src/agents/plan-converter.ts:29
Decomposed subtasks (empty if task didn’t need decomposition)
Inherited from
ExecutionPlanData.subtasks
taskId
taskId: string;
Defined in: packages/nexus-agents/src/agents/plan-converter.ts:25
The original task ID this plan was created for
Inherited from
ExecutionPlanData.taskId
Methods
asWorkflowDefinition()
asWorkflowDefinition(options?): WorkflowDefinition;
Defined in: packages/nexus-agents/src/agents/tech-lead.ts:161
Convert this execution plan to a reusable WorkflowDefinition.
This “crystallizes” the dynamic plan into a static, replayable workflow that can be executed by WorkflowEngine.
Parameters
options?
PlanConversionOptions
Optional conversion configuration
Returns
A valid WorkflowDefinition
Example
const result = await techLead.execute(task);
const plan = result.value.output as ExecutionPlan;
const workflow = plan.asWorkflowDefinition({
name: 'my-workflow',
version: '1.0.0',
});
await workflowEngine.execute(workflow, inputs);
ExpertAssignment
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:96
Expert assignment for a subtask.
Properties
confidence
confidence: number;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:104
Confidence in the assignment (0-1)
expertRole
expertRole: AgentRole;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:100
Assigned expert role
ictmConfig?
optional ictmConfig?: ICTMConfig;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:106
ICTM configuration for dynamic sub-agent creation (Issue #756)
selectionReason
selectionReason: string;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:102
Reason for selection
subtaskId
subtaskId: string;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:98
Subtask ID
ExpertConfig
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:48
Configuration for creating a dynamic expert agent.
Properties
capabilities
capabilities: AgentCapability[];
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:58
List of capabilities this expert has
id
id: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:50
Unique identifier for this expert
metadata?
optional metadata?: Record<string, unknown>;
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:64
Optional metadata for extensions
modelPreference?
optional modelPreference?: ModelPreference;
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:60
Optional model preferences
name
name: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:52
Human-readable name
role
role: AgentRole;
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:54
Role classification
systemPrompt
systemPrompt: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:56
System prompt defining the expert’s behavior
toolRestrictions?
optional toolRestrictions?: {
allowedTools?: string[];
deniedTools?: string[];
};
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:62
Optional tool restrictions (allowlist/denylist per role)
allowedTools?
optional allowedTools?: string[];
Tools the expert is allowed to use (allowlist — exclusive).
deniedTools?
optional deniedTools?: string[];
Tools the expert is NOT allowed to use (denylist — additive).
ExpertDefinition
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:38
Definition of an expert’s capabilities and metadata.
Properties
available
available: boolean;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:56
Whether the expert is currently available
capabilities
capabilities: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:48
Core capabilities
description
description: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:46
Description of expert’s specialty
id
id: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:40
Unique expert identifier
name
name: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:44
Human-readable name
primaryDomain
primaryDomain: ExpertTaskDomain;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:50
Primary domain of expertise
role
role: AgentRole;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:42
Expert role type
secondaryDomains
secondaryDomains: ExpertTaskDomain[];
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:52
Additional domains the expert can handle
weight
weight: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:54
Base weight for scoring (0-1)
ExpertMatch
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:85
Match result for a single expert.
Properties
expertId
expertId: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:87
Expert identifier
matchedCapabilities
matchedCapabilities: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:91
Capabilities that matched the task
reasoning
reasoning: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:93
Human-readable reasoning for the match
score
score: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:89
Match score (0-1)
scoreBreakdown
scoreBreakdown: ScoreBreakdown;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:95
Breakdown of score components
ExpertOptions
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:16
Expert-specific configuration options.
Extended by
CodeExpertOptionsSecurityExpertOptionsArchitectureExpertOptionsTestingExpertOptionsDocumentationExpertOptions
Properties
additionalCapabilities?
optional additionalCapabilities?: AgentCapability[];
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:26
Custom capability extensions
enableHeuristics?
optional enableHeuristics?: boolean;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:24
Enable domain-specific heuristics
maxTokens?
optional maxTokens?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:22
Maximum tokens for responses
systemPromptOverride?
optional systemPromptOverride?: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:18
Custom system prompt override
temperature?
optional temperature?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:20
Temperature for completions (domain-specific default if not set)
ExpertOutput
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:32
Output format for expert task results.
Extended by
CodeAnalysisResultSecurityAnalysisResultArchitectureAnalysisResultTestingAnalysisResultDocumentationResult
Properties
confidence
confidence: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:42
Confidence score (0-1)
content
content: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:34
Primary result content
modelUsed?
optional modelUsed?: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:44
Model used for this expert’s execution (Issue #817)
recommendations?
optional recommendations?: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:38
Recommendations or suggestions
structuredData?
optional structuredData?: Record<string, unknown>;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:36
Structured data if applicable
warnings?
optional warnings?: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:40
Warnings or issues found
ExpertParticipation
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:81
Expert participation record in a session.
Properties
expertId
expertId: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:82
joinedAt
joinedAt: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:84
retryCount
retryCount: number;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:87
role
role: AgentRole;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:83
status
status: "failed" | "working" | "pending" | "submitted" | "reviewing" | "voted";
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:85
submittedAt?
optional submittedAt?: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:86
ExpertRecoveryPolicy
Defined in: packages/nexus-agents/src/agents/experts/expert-recovery.ts:93
Opt-in recovery policy attached to an expert at creation time. All fields are optional and fall through to DEFAULT_RETRY_CONFIG (retry knobs) and this module’s detector defaults.
Properties
baseDelayMs?
optional baseDelayMs?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-recovery.ts:101
Base backoff delay (ms). Default: DEFAULT_RETRY_CONFIG.
detectorConfig?
optional detectorConfig?: Partial<DetectorConfig>;
Defined in: packages/nexus-agents/src/agents/experts/expert-recovery.ts:107
Override the failure detector configuration.
jitterFactor?
optional jitterFactor?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-recovery.ts:105
Jitter factor (0-1). Default: DEFAULT_RETRY_CONFIG.
maxDelayMs?
optional maxDelayMs?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-recovery.ts:103
Maximum backoff delay (ms). Default: DEFAULT_RETRY_CONFIG.
maxRetries?
optional maxRetries?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-recovery.ts:99
Maximum retries (attempts = maxRetries + 1). Default: EXPERT_RECOVERY_DEFAULT_MAX_RETRIES (1 → 2 attempts), NOT DEFAULT_RETRY_CONFIG.maxRetries (3).
ExpertRegisterOptions
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:28
Options for registering an expert.
Properties
replace?
optional replace?: boolean;
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:30
Whether to replace if expert with same ID exists
ExpertResult
Defined in: packages/nexus-agents/src/agents/collaboration/aggregator-types.ts:24
Expert result with metadata.
Properties
confidence?
optional confidence?: number;
Defined in: packages/nexus-agents/src/agents/collaboration/aggregator-types.ts:27
expertId
expertId: string;
Defined in: packages/nexus-agents/src/agents/collaboration/aggregator-types.ts:25
order?
optional order?: number;
Defined in: packages/nexus-agents/src/agents/collaboration/aggregator-types.ts:28
result
result: TaskResult;
Defined in: packages/nexus-agents/src/agents/collaboration/aggregator-types.ts:26
ExpertResultSummary
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:215
Summary of an expert’s contribution.
Properties
contributionScore
contributionScore: number;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:219
error?
optional error?: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:222
executionTimeMs
executionTimeMs: number;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:220
expertId
expertId: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:216
result?
optional result?: TaskResult;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:218
role
role: AgentRole;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:217
success
success: boolean;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:221
ExplorationEvent
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:124
An event in the exploration history for debugging/analysis.
Properties
details
readonly details: Record<string, unknown>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:134
Additional details
eventType
readonly eventType: ExplorationEventType;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:128
Event type
nodeId?
readonly optional nodeId?: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:132
Node ID involved
timestamp
readonly timestamp: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:126
Timestamp
treeId?
readonly optional treeId?: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:130
Tree ID involved
FailurePattern
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:86
A pattern that has been identified as ineffective.
Properties
avgFailureScore
readonly avgFailureScore: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:92
Average quality score when this pattern appeared
occurrences
readonly occurrences: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:90
Number of times this pattern failed
pattern
readonly pattern: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:88
Pattern description
FeedbackMessage
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:153
General feedback message.
Properties
category?
optional category?: "improvement" | "concern" | "praise" | "question";
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:158
expertId
expertId: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:155
feedback
feedback: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:157
targetExpertId?
optional targetExpertId?: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:156
type
type: "feedback";
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:154
Forest
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:136
A forest of reasoning trees with sparse activation. Coordinates multiple parallel reasoning approaches.
Properties
activationBudget
readonly activationBudget: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:154
Maximum number of active nodes (sparse activation budget)
activeTreeIds
readonly activeTreeIds: readonly string[];
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:156
Currently active tree IDs
bestPaths
readonly bestPaths: readonly PathScore[];
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:147
Best paths across all trees
createdAt
readonly createdAt: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:159
Creation timestamp
crossTreeInfo
readonly crossTreeInfo: CrossTreeInfo;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:149
Cross-tree shared information
id
readonly id: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:138
Unique forest identifier
problem
readonly problem: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:140
Problem being solved
state
readonly state: ForestState;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:145
Current state of the forest
statistics
readonly statistics: ForestStatistics;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:151
Forest-wide statistics
trees
readonly trees: ReadonlyMap<string, ReasoningTree>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:142
All trees in the forest (id -> tree)
updatedAt
readonly updatedAt: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:161
Last update timestamp
ForestConfig
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:69
Configuration for Forest-of-Thought reasoning.
Properties
activationBudget
readonly activationBudget: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:77
Total activation budget (max active nodes across forest)
activationStrategy
readonly activationStrategy: ActivationStrategy;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:82
Strategy for node activation
confidenceThreshold
readonly confidenceThreshold: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:93
Confidence threshold for accepting conclusions
crossTreeStrategy
readonly crossTreeStrategy: CrossTreeStrategy;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:86
Strategy for cross-tree information sharing
earlyTerminationThreshold
readonly earlyTerminationThreshold: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:95
Score threshold for early termination
enableCrossTreeSharing
readonly enableCrossTreeSharing: boolean;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:111
Enable cross-tree information sharing
enableEarlyTermination
readonly enableEarlyTermination: boolean;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:109
Enable early termination when good solution found
enableParallelExploration
readonly enableParallelExploration: boolean;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:105
Enable parallel tree exploration
explorationConstant
readonly explorationConstant: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:84
UCB exploration constant (for ucb strategy)
maxDepth
readonly maxDepth: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:73
Maximum depth per tree
maxExplorationTimeMs
readonly maxExplorationTimeMs: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:98
Maximum exploration time in ms
maxNodesPerTree
readonly maxNodesPerTree: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:75
Maximum nodes per tree
maxTokensPerTree
readonly maxTokensPerTree: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:102
Maximum tokens per tree
maxTrees
readonly maxTrees: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:71
Maximum number of trees in the forest
minScoreThreshold
readonly minScoreThreshold: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:91
Minimum score threshold for keeping nodes
nodeTimeoutMs
readonly nodeTimeoutMs: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:100
Timeout per node evaluation in ms
parallelThreads
readonly parallelThreads: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:107
Number of parallel exploration threads
pruningStrategy
readonly pruningStrategy: ForestPruningStrategy;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:88
Strategy for pruning low-quality branches
seed
readonly seed: number | null;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:116
Random seed for reproducibility (null for random)
sparsityRatio
readonly sparsityRatio: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:79
Percentage of nodes to keep active (0-1)
temperature
readonly temperature: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:114
Temperature for node generation (creativity vs determinism)
ForestResult
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:155
Result of Forest-of-Thought reasoning.
Properties
bestSolution
readonly bestSolution: BestSolution | null;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:162
Best solution found
conclusions
readonly conclusions: readonly ReasoningNode[];
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:166
All conclusions reached across trees
durationMs
readonly durationMs: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:176
Total duration in ms
explorationHistory?
readonly optional explorationHistory?: readonly ExplorationEvent[];
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:181
Exploration history for analysis
finalState
readonly finalState: ForestState;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:169
Final state of the forest
forestId
readonly forestId: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:157
Forest ID
problem
readonly problem: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:159
Original problem
statistics
readonly statistics: ForestStatistics;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:173
Final statistics
terminationReason
readonly terminationReason: TerminationReason;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:171
Reason for termination
topPaths
readonly topPaths: readonly PathScore[];
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:164
All high-quality paths found
totalTokensUsed
readonly totalTokensUsed: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:178
Total tokens used
ForestStatistics
Defined in: packages/nexus-agents/src/agents/reasoning/forest-state-types.ts:48
Statistics about forest exploration.
Properties
activationRatio
readonly activationRatio: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-state-types.ts:68
Activation ratio (active nodes / total nodes)
activeTrees
readonly activeTrees: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-state-types.ts:52
Number of active trees
avgTreeScore
readonly avgTreeScore: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-state-types.ts:62
Average tree score
bestPathScore
readonly bestPathScore: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-state-types.ts:60
Best path score found
maxDepth
readonly maxDepth: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-state-types.ts:58
Maximum depth across all trees
totalActiveNodes
readonly totalActiveNodes: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-state-types.ts:56
Total active nodes across all trees
totalExplorationTimeMs
readonly totalExplorationTimeMs: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-state-types.ts:66
Total exploration time in ms
totalNodes
readonly totalNodes: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-state-types.ts:54
Total nodes across all trees
totalTokensUsed
readonly totalTokensUsed: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-state-types.ts:64
Total tokens used
totalTrees
readonly totalTrees: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-state-types.ts:50
Total number of trees
GeneratedTest
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:191
Generated test case.
Properties
code
code: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:197
Test code
name
name: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:193
Test name
scenarios
scenarios: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:201
Test scenarios covered
target
target: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:199
Target function/component
type
type: "integration" | "e2e" | "unit";
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:195
Test type
IAgenticAdapter
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:164
The agentic-adapter contract. Single method; all the variability
lives in RunAgentArgs.
Properties
adapterStrategy
readonly adapterStrategy: string;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:167
modelId
readonly modelId: string;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:166
providerId
readonly providerId: string;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:165
Methods
runAgent()
runAgent(args): Promise<Result<AgentRunResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:168
Parameters
args
Returns
Promise<Result<AgentRunResult, AgentError>>
ICollaborationProtocol
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:304
Base interface for collaboration protocols.
NOTE: This interface is defined here (not in collaboration-protocol.ts) to avoid circular dependencies. Protocol implementations import this interface, and collaboration-protocol.ts imports the implementations.
Properties
pattern
readonly pattern: CollaborationPattern;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:305
Methods
cancel()
cancel(reason): void;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:310
Parameters
reason
string
Returns
void
execute()
execute(config, agents): Promise<Result<CollaborationResult, AgentError>>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:306
Parameters
config
agents
Map<string, IAgent>
Returns
Promise<Result<CollaborationResult, AgentError>>
ModelPreference
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:34
Model preference configuration for an expert.
Properties
maxTokens?
optional maxTokens?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:42
Maximum tokens for responses
modelId?
optional modelId?: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:38
Specific model ID
provider?
optional provider?: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:36
Provider ID (e.g., ‘anthropic’, ‘openai’)
temperature?
optional temperature?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:40
Temperature for generation (0.0 - 2.0)
OrchestratorOptions
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:178
Options for the Orchestrator agent (coordination, decomposition, delegation).
Remarks
Renamed from TechLeadOptions in Issue #759. The old name is retained as a deprecated type alias.
Properties
decompositionThreshold?
optional decompositionThreshold?: number;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:182
Minimum complexity to trigger decomposition
enableParallelHints?
optional enableParallelHints?: boolean;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:184
Enable parallel execution hints
expertWeights?
optional expertWeights?: Partial<Record<AgentRole, number>>;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:186
Custom expert selection weights
maxSubtasks?
optional maxSubtasks?: number;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:180
Maximum number of subtasks to create
PathScore
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:67
A scored path through a reasoning tree from root to a target node.
Properties
breakdown
readonly breakdown: PathScoreBreakdown;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:77
Detailed score breakdown
length
readonly length: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:81
Path length (number of nodes)
path
readonly path: readonly string[];
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:71
Ordered node IDs from root to target
reachesConclusion
readonly reachesConclusion: boolean;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:79
Whether this path reaches a conclusion
score
readonly score: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:75
Overall path score (0-1)
targetNodeId
readonly targetNodeId: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:73
Target node (usually a conclusion)
treeId
readonly treeId: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:69
Tree this path belongs to
PathScoreBreakdown
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:40
Scoring breakdown for a reasoning path.
Properties
coherenceScore
readonly coherenceScore: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:46
Coherence score (logical consistency between steps)
conclusionBonus
readonly conclusionBonus: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:50
Bonus for reaching conclusion
confidenceScore
readonly confidenceScore: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:42
Average confidence across path nodes
depthFactor
readonly depthFactor: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:48
Depth penalty or bonus based on path length
qualityScore
readonly qualityScore: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:44
Average quality across path nodes
PathScoringOptions
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:100
Options for scoring a path.
Properties
coherenceWeight
readonly coherenceWeight: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:106
Weight for coherence in scoring
conclusionBonus
readonly conclusionBonus: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:110
Bonus for reaching conclusion
confidenceWeight
readonly confidenceWeight: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:102
Weight for confidence in scoring
depthPenalty
readonly depthPenalty: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:108
Penalty per depth level
qualityWeight
readonly qualityWeight: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:104
Weight for quality in scoring
ProtocolOptions
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:320
Options for protocol execution.
NOTE: sessionOptions uses a generic Record type to avoid circular dependency with collaboration-session.ts. The actual type is CollaborationSessionOptions which is defined in collaboration-session.ts.
Properties
continueOnFailure?
optional continueOnFailure?: boolean;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:325
logger?
optional logger?: ILogger;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:321
sequentialDelay?
optional sequentialDelay?: number;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:324
sessionOptions?
optional sessionOptions?: Record<string, unknown>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:323
Session options - accepts CollaborationSessionOptions from collaboration-session.ts
PruneOptions
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:82
Options for a pruning operation.
Properties
categories?
optional categories?: ("system" | "task" | "active")[];
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:85
hierarchicalOptions?
optional hierarchicalOptions?: Partial<HierarchicalOptions>;
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:88
semanticOptions?
optional semanticOptions?: Partial<SemanticOptions>;
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:89
slidingWindowOptions?
optional slidingWindowOptions?: Partial<SlidingWindowOptions>;
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:87
strategy?
optional strategy?: PruningStrategy;
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:84
summarizationPrompt?
optional summarizationPrompt?: string;
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:86
targetTokens?
optional targetTokens?: number;
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:83
PruneResult
Defined in: packages/nexus-agents/src/agents/pruning-strategies-types.ts:240
Result of a pruning operation.
Properties
removedItems
removedItems: ContextItem[];
Defined in: packages/nexus-agents/src/agents/pruning-strategies-types.ts:241
summarizedItems
summarizedItems: ContextItem[];
Defined in: packages/nexus-agents/src/agents/pruning-strategies-types.ts:242
summaryItem?
optional summaryItem?: ContextItem;
Defined in: packages/nexus-agents/src/agents/pruning-strategies-types.ts:243
targetReached
targetReached: boolean;
Defined in: packages/nexus-agents/src/agents/pruning-strategies-types.ts:245
tokensFreed
tokensFreed: number;
Defined in: packages/nexus-agents/src/agents/pruning-strategies-types.ts:244
QueryOptions
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:36
Query options for finding experts.
Properties
anyCapability?
optional anyCapability?: AgentCapability[];
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:42
Filter by capability (expert must have at least one)
capabilities?
optional capabilities?: AgentCapability[];
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:40
Filter by capability (expert must have all specified)
limit?
optional limit?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:44
Maximum number of results
role?
optional role?: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:38
Filter by role
ReasoningNode
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:117
A single reasoning step in a reasoning tree. Represents an atomic unit of thought with content, scoring, and metadata.
Properties
activationScore
readonly activationScore: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:141
Activation score determining priority (higher = more likely to activate)
children
readonly children: readonly string[];
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:125
Child node IDs
confidence
readonly confidence: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:144
Confidence in this reasoning step (0-1)
content
readonly content: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:132
The reasoning content/thought at this step
createdAt
readonly createdAt: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:151
Creation timestamp
depth
readonly depth: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:127
Depth in the tree (0 for root)
estimatedValue
readonly estimatedValue: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:148
Estimated value for path selection (like MCTS value)
id
readonly id: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:119
Unique node identifier
isActive
readonly isActive: boolean;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:139
Whether this node is currently activated (for sparse activation)
metadata
readonly metadata: ReasoningNodeMetadata;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:134
Optional structured data associated with this step
parentId
readonly parentId: string | null;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:123
Parent node ID (null for root nodes)
qualityScore
readonly qualityScore: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:146
Quality score from evaluation (0-1)
state
readonly state: NodeState;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:137
Current state of this node
stepType
readonly stepType: ReasoningStepType;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:130
Type of reasoning step
treeId
readonly treeId: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:121
ID of the tree this node belongs to
updatedAt
readonly updatedAt: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:153
Last update timestamp
ReasoningNodeMetadata
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:89
Metadata associated with a reasoning node.
Properties
crossReferences?
readonly optional crossReferences?: readonly string[];
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:97
References to other nodes that informed this reasoning
custom?
readonly optional custom?: Record<string, unknown>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:99
Custom key-value pairs for extensibility
generationTimeMs?
readonly optional generationTimeMs?: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:95
Time taken to generate this node in ms
source?
readonly optional source?: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:91
Source of this reasoning (model, tool, etc.)
tokensUsed?
readonly optional tokensUsed?: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:93
Tokens used to generate this node
ReasoningTree
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:172
A reasoning tree containing nodes organized hierarchically. Each tree explores one approach to solving the problem.
Properties
bestPaths
readonly bestPaths: readonly PathScore[];
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:192
Best path(s) found in this tree
createdAt
readonly createdAt: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:197
Creation timestamp
explorationPriority
readonly explorationPriority: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:187
Priority for exploration (higher = explore first)
forestId
readonly forestId: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:176
ID of the forest this tree belongs to
hypothesis
readonly hypothesis: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:190
Tree hypothesis or approach description
id
readonly id: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:174
Unique tree identifier
nodes
readonly nodes: ReadonlyMap<string, ReasoningNode>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:180
All nodes in this tree (id -> node)
overallScore
readonly overallScore: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:185
Overall tree score for ranking (0-1)
rootId
readonly rootId: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:178
Root node ID
state
readonly state: TreeState;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:183
Current state of the tree
statistics
readonly statistics: TreeStatistics;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:194
Tree statistics
updatedAt
readonly updatedAt: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:199
Last update timestamp
RegistryStats
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:51
Statistics about the registry. Extends IRegistryStats for interface compatibility (ADR-0012).
Extends
IRegistryStats
Indexable
[key: string]: unknown
Additional stats specific to the registry type
Properties
byCapability
byCapability: Record<string, number>;
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:57
Count by capability
byRole
byRole: Record<string, number>;
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:55
Count by role
total
total: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:53
Total number of registered experts (IRegistryStats alias)
Overrides
IRegistryStats.total
ResultConflict
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:239
Conflict between expert results.
Properties
description
description: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:243
expert1Id
expert1Id: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:240
expert2Id
expert2Id: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:241
field
field: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:242
resolution
resolution: "unresolved" | "merged" | "expert1" | "expert2";
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:244
resolutionReason?
optional resolutionReason?: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:245
ResultSubmissionMessage
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:117
Result submission from an expert.
Properties
confidence?
optional confidence?: number;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:121
expertId
expertId: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:119
notes?
optional notes?: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:122
result
result: TaskResult;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:120
type
type: "result_submission";
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:118
ResultSummary
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:146
Summary of a single result.
Properties
contributions
contributions: string[];
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:154
Key contributions to final output
quality
quality: number;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:152
Quality of this result (0-1)
subtaskId
subtaskId: string;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:148
Subtask ID
summary
summary: string;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:150
Brief summary of the output
ReviewRequestMessage
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:128
Review request from one expert to another.
Properties
artifact
artifact: unknown;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:132
criteria?
optional criteria?: string[];
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:133
deadline?
optional deadline?: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:134
fromExpert
fromExpert: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:130
toExpert
toExpert: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:131
type
type: "review_request";
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:129
ReviewResponseMessage
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:140
Review response from a reviewer.
Properties
approved
approved: boolean;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:144
feedback
feedback: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:145
requesterId
requesterId: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:143
reviewerId
reviewerId: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:142
severity?
optional severity?: "critical" | "none" | "major" | "minor";
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:147
suggestions?
optional suggestions?: string[];
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:146
type
type: "review_response";
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:141
RunAgentArgs
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:141
Arguments to runAgent.
onToolCall is the harness’s tool-router; the adapter awaits its
Promise<ToolResult> so synchronous and async harness execution
both work. Per-tool timeouts are the harness’s responsibility (the
adapter doesn’t impose one — see #2529 design notes).
onTurn (optional) fires once after each turn completes, giving
operators incremental progress visibility.
signal (optional) propagates external cancellation as
stopReason: 'cancelled'.
Properties
maxTokens?
readonly optional maxTokens?: number;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:157
Per-turn maxTokens passed through to IModelAdapter.complete.
onToolCall
readonly onToolCall: (call) => Promise<AgenticToolResult>;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:151
Parameters
call
Returns
Promise<AgenticToolResult>
onTurn?
readonly optional onTurn?: (turn) => void;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:152
Parameters
turn
Returns
void
signal?
readonly optional signal?: AbortSignal;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:153
systemPrompt
readonly systemPrompt: string;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:142
temperature?
readonly optional temperature?: number;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:155
Sampling temperature passed through to IModelAdapter.complete.
tools
readonly tools: readonly ToolDefinition[];
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:144
turnBudget?
readonly optional turnBudget?: number;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:150
Maximum agent turns. When omitted, the adapter uses the resolved
model’s profile.maxRecommendedTurnBudget (claude-opus = 20,
o-reasoning = 25, claude-haiku / gemini-flash = 8, defaults to 10).
userPrompt
readonly userPrompt: string;
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:143
ScoreBreakdown
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:71
Breakdown of how the match score was calculated.
Properties
capabilityScore
capabilityScore: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:73
Score from capability matching (0-1)
domainScore
domainScore: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:75
Score from domain alignment (0-1)
finalScore
finalScore: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:79
Combined final score (0-1)
weightScore
weightScore: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:77
Score from weight adjustment (0-1)
SecurityAnalysisResult
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:61
Security analysis result from SecurityExpert.
Extends
Properties
compliance?
optional compliance?: ComplianceStatus;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:79
Compliance status
confidence
confidence: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:42
Confidence score (0-1)
Inherited from
content
content: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:34
Primary result content
Inherited from
findingsCoverage?
optional findingsCoverage?: "unmeasured" | "partial" | "complete";
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:77
Coverage of the model-supplied findings after validation. When
findingsCoverage === 'unmeasured', securityScore is 0: a fail-closed placeholder and the
worst score, so a reader that ignores the marker errs toward blocking, never toward a clean
100. partial keeps the score over the validated findings; complete is unchanged.
modelUsed?
optional modelUsed?: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:44
Model used for this expert’s execution (Issue #817)
Inherited from
recommendations?
optional recommendations?: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:38
Recommendations or suggestions
Inherited from
securityScore
securityScore: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:70
Security score (0-100). When findingsCoverage === 'unmeasured', securityScore is 0: a
fail-closed placeholder and the worst score, so a reader that ignores the marker errs toward
blocking, never toward a clean 100. partial scores only the validated findings; complete is
unchanged.
structuredData?
optional structuredData?: Record<string, unknown>;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:36
Structured data if applicable
Inherited from
vulnerabilities
vulnerabilities: Vulnerability[];
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:63
Vulnerabilities found
warnings?
optional warnings?: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:40
Warnings or issues found
Inherited from
SecurityExpertOptions
Defined in: packages/nexus-agents/src/agents/experts/security-expert.ts:40
Configuration options for SecurityExpert.
Extends
Properties
additionalCapabilities?
optional additionalCapabilities?: AgentCapability[];
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:26
Custom capability extensions
Inherited from
ExpertOptions.additionalCapabilities
complianceFrameworks?
optional complianceFrameworks?: string[];
Defined in: packages/nexus-agents/src/agents/experts/security-expert.ts:42
Compliance frameworks to check
enableCweMapping?
optional enableCweMapping?: boolean;
Defined in: packages/nexus-agents/src/agents/experts/security-expert.ts:46
Enable detailed CWE mappings
enableHeuristics?
optional enableHeuristics?: boolean;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:24
Enable domain-specific heuristics
Inherited from
ExpertOptions.enableHeuristics
focusAreas?
optional focusAreas?: SecurityFocusArea[];
Defined in: packages/nexus-agents/src/agents/experts/security-expert.ts:48
Security focus areas
maxTokens?
optional maxTokens?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:22
Maximum tokens for responses
Inherited from
minSeverity?
optional minSeverity?: "critical" | "info" | "high" | "low" | "medium";
Defined in: packages/nexus-agents/src/agents/experts/security-expert.ts:44
Minimum severity to report
systemPromptOverride?
optional systemPromptOverride?: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:18
Custom system prompt override
Inherited from
ExpertOptions.systemPromptOverride
temperature?
optional temperature?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:20
Temperature for completions (domain-specific default if not set)
Inherited from
SelectionExpertRegistry
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:60
Registry of available experts.
Methods
getAll()
getAll(): ExpertDefinition[];
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:61
Returns
getAvailable()
getAvailable(): ExpertDefinition[];
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:65
Returns
getByDomain()
getByDomain(domain): ExpertDefinition[];
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:64
Parameters
domain
ExpertTaskDomain
Returns
getById()
getById(id): ExpertDefinition | undefined;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:62
Parameters
id
string
Returns
ExpertDefinition | undefined
getByRole()
getByRole(role): ExpertDefinition[];
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:63
Parameters
role
Returns
SelectionOptions
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:108
Options for expert selection.
Properties
capabilityWeights?
optional capabilityWeights?: Record<string, number>;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:111
excludeExperts?
optional excludeExperts?: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:113
forceCollaboration?
optional forceCollaboration?: boolean;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:114
maxAlternatives?
optional maxAlternatives?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:110
minScore?
optional minScore?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:109
preferredDomains?
optional preferredDomains?: ExpertTaskDomain[];
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:112
SelectionResult
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:99
Result of expert selection.
Properties
alternatives
alternatives: ExpertMatch[];
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:101
confidence
confidence: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:104
primary
primary: ExpertMatch;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:100
requiresCollaboration
requiresCollaboration: boolean;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:102
suggestedPattern?
optional suggestedPattern?: ExpertCollaborationPatternType;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:103
SessionState
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:186
Aggregated session status.
Properties
completedAt?
optional completedAt?: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:194
config
config: CollaborationConfig;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:187
error?
optional error?: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:195
messageLog
messageLog: CollaborationMessage[];
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:196
participants
participants: ExpertParticipation[];
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:189
results
results: Map<string, TaskResult>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:190
reviews
reviews: ReviewResponseMessage[];
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:191
startedAt
startedAt: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:193
status
status: SessionStatus;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:188
votes
votes: VoteMessage[];
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:192
SharedConclusion
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:35
A conclusion shared across trees for cross-pollination.
Properties
confidence
readonly confidence: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:43
Confidence in this conclusion
content
readonly content: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:41
The conclusion content
qualityScore
readonly qualityScore: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:45
Quality score
sourceNodeId
readonly sourceNodeId: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:39
Source node ID
sourceTreeId
readonly sourceTreeId: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:37
Source tree ID
SharedInsight
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:62
An insight shared across trees.
Properties
content
readonly content: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:68
The insight content
relevance
readonly relevance: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:70
Relevance score for current exploration
sourceNodeId
readonly sourceNodeId: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:66
Source node ID
sourceTreeId
readonly sourceTreeId: string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:64
Source tree ID
StateMachineOptions
Defined in: packages/nexus-agents/src/agents/state-machine-types.ts:57
State machine options.
Properties
initialState?
optional initialState?: AgentState;
Defined in: packages/nexus-agents/src/agents/state-machine-types.ts:59
Initial state (defaults to ‘idle’)
maxErrorCount?
optional maxErrorCount?: number;
Defined in: packages/nexus-agents/src/agents/state-machine-types.ts:61
Maximum error count before permanent error state
maxHistorySize?
optional maxHistorySize?: number;
Defined in: packages/nexus-agents/src/agents/state-machine-types.ts:65
Maximum history entries to keep
trackHistory?
optional trackHistory?: boolean;
Defined in: packages/nexus-agents/src/agents/state-machine-types.ts:63
Enable transition history tracking
StateTransition
Defined in: packages/nexus-agents/src/agents/state-machine-types.ts:27
State transition metadata.
Properties
context?
optional context?: Record<string, unknown>;
Defined in: packages/nexus-agents/src/agents/state-machine-types.ts:37
Optional context data
event
event: StateTransitionEvent;
Defined in: packages/nexus-agents/src/agents/state-machine-types.ts:33
Event that triggered the transition
from
from: AgentState;
Defined in: packages/nexus-agents/src/agents/state-machine-types.ts:29
Previous state
timestamp
timestamp: string;
Defined in: packages/nexus-agents/src/agents/state-machine-types.ts:35
Timestamp of the transition
to
to: AgentState;
Defined in: packages/nexus-agents/src/agents/state-machine-types.ts:31
New state
StatusUpdateMessage
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:175
Status update message.
Properties
estimatedTimeRemaining?
optional estimatedTimeRemaining?: number;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:180
expertId
expertId: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:177
progress?
optional progress?: number;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:179
status
status: "failed" | "working" | "pending" | "submitted" | "reviewing" | "voted";
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:178
type
type: "status_update";
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:176
SubTask
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:26
A subtask broken down from the main task.
Properties
assignedRole?
optional assignedRole?: AgentRole;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:42
Assigned expert role (if any)
complexity
complexity: number;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:44
Estimated complexity (1-10)
dependencies
dependencies: string[];
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:36
Dependencies on other subtasks (by ID)
description
description: string;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:32
Description of what needs to be done
expectedOutput
expectedOutput: string;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:34
Expected output format or type
id
id: string;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:28
Unique subtask identifier
parentTaskId
parentTaskId: string;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:30
Parent task ID
priority
priority: SubtaskPriority;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:38
Priority level
requiredCapabilities
requiredCapabilities: string[];
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:46
Required capabilities for this subtask
status
status: SubtaskStatus;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:40
Current status
SynthesizedResult
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:126
Synthesis of multiple task results.
Properties
collaborationMetadata?
optional collaborationMetadata?: CollaborationMetadata;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:140
Collaboration metadata if collaborative synthesis was used (Issue #488)
combinedOutput
combinedOutput: string;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:128
Combined output from all results
conflicts
conflicts: Conflict[];
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:134
Any conflicts detected between results
qualityScore
qualityScore: number;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:136
Overall quality assessment
recommendations
recommendations: string[];
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:138
Recommendations for follow-up
resultSummaries
resultSummaries: ResultSummary[];
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:132
Individual result summaries
summary
summary: string;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:130
Summary of the synthesis process
SystemComponent
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:163
System component in architecture.
Properties
dependencies
dependencies: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:171
Dependencies
name
name: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:165
Component name
responsibilities
responsibilities: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:169
Responsibilities
type
type: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:167
Component type
TaskAnalysis
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:52
Result of task analysis.
Properties
approach
approach: string;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:66
Recommended approach
commitment?
optional commitment?: TaskCommitment;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:75
Commit-before-generate block (#1827). Forces the orchestrator to commit to a direction before dispatching workers, countering LLM mode-collapse toward safe defaults. Optional for backward compatibility with older analysis outputs.
complexity
complexity: number;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:56
Overall complexity score (1-10)
estimatedEffort
estimatedEffort: number;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:68
Estimated total effort in relative units
needsDecomposition
needsDecomposition: boolean;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:64
Whether task needs decomposition
requirements
requirements: string[];
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:60
Key requirements extracted from the task
risks
risks: string[];
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:62
Identified risks or challenges
taskId
taskId: string;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:54
Task ID being analyzed
taskType
taskType: string;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:58
Type of task (code, architecture, documentation, etc.)
TaskAssignmentMessage
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:105
Task assignment message sent to an expert.
Properties
deadline?
optional deadline?: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:111
expertId
expertId: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:107
previousResults?
optional previousResults?: TaskResult[];
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:110
sequencePosition?
optional sequencePosition?: number;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:109
task
task: Task;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:108
type
type: "task_assignment";
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:106
TaskCommitment
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:82
Orchestrator’s directional commitment, emitted before decomposition (#1827).
Modeled after the frontend-design plugin’s Design Thinking pre-phase.
Properties
approach
approach: string;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:86
The non-obvious choice being made.
constraints
constraints: string[];
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:90
Hard limits: deadlines, scope boundaries, invariants.
differentiation
differentiation: string;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:88
What would make the output worse if solved by default patterns.
purpose
purpose: string;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:84
What this task is fundamentally about (one sentence).
TestingAnalysisResult
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:177
Testing analysis result from TestingExpert.
Extends
Properties
confidence
confidence: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:42
Confidence score (0-1)
Inherited from
content
content: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:34
Primary result content
Inherited from
coverage?
optional coverage?: CoverageMetrics;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:183
Coverage metrics
modelUsed?
optional modelUsed?: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:44
Model used for this expert’s execution (Issue #817)
Inherited from
operationType
operationType: "generation" | "coverage_analysis" | "quality_assessment";
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:179
Operation type
quality?
optional quality?: TestQuality;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:185
Test quality assessment
recommendations?
optional recommendations?: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:38
Recommendations or suggestions
Inherited from
structuredData?
optional structuredData?: Record<string, unknown>;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:36
Structured data if applicable
Inherited from
tests?
optional tests?: GeneratedTest[];
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:181
Generated tests
warnings?
optional warnings?: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:40
Warnings or issues found
Inherited from
TestingExpertOptions
Defined in: packages/nexus-agents/src/agents/experts/testing-expert.ts:44
Configuration options for TestingExpert.
Extends
Properties
additionalCapabilities?
optional additionalCapabilities?: AgentCapability[];
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:26
Custom capability extensions
Inherited from
ExpertOptions.additionalCapabilities
enableHeuristics?
optional enableHeuristics?: boolean;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:24
Enable domain-specific heuristics
Inherited from
ExpertOptions.enableHeuristics
framework?
optional framework?: "vitest" | "jest" | "playwright" | "mocha" | "cypress";
Defined in: packages/nexus-agents/src/agents/experts/testing-expert.ts:46
Preferred testing framework
generateFactories?
optional generateFactories?: boolean;
Defined in: packages/nexus-agents/src/agents/experts/testing-expert.ts:54
Generate test data factories
includeMocking?
optional includeMocking?: boolean;
Defined in: packages/nexus-agents/src/agents/experts/testing-expert.ts:50
Include mocking strategies
maxTokens?
optional maxTokens?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:22
Maximum tokens for responses
Inherited from
systemPromptOverride?
optional systemPromptOverride?: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:18
Custom system prompt override
Inherited from
ExpertOptions.systemPromptOverride
targetCoverage?
optional targetCoverage?: number;
Defined in: packages/nexus-agents/src/agents/experts/testing-expert.ts:48
Target coverage percentage
temperature?
optional temperature?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-base-types.ts:20
Temperature for completions (domain-specific default if not set)
Inherited from
testStyle?
optional testStyle?: "behavioral" | "tdd" | "bdd";
Defined in: packages/nexus-agents/src/agents/experts/testing-expert.ts:52
Test style preference
TestQuality
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:223
Test quality assessment.
Properties
assertionQuality
assertionQuality: "good" | "fair" | "poor";
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:229
Assertion quality
isolation
isolation: "good" | "fair" | "poor";
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:227
Test isolation
issues
issues: string[];
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:231
Issues found
score
score: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:225
Overall score (0-100)
ThinkerOutput
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:128
Thinker’s analysis output.
Properties
approach
readonly approach: string;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:132
Execution approach/plan
considerations
readonly considerations: string[];
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:134
Considerations and edge cases
problemAnalysis
readonly problemAnalysis: string;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:130
Problem analysis
successCriteria
readonly successCriteria: string[];
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:136
Success criteria
TreeStatistics
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:131
Statistics for a reasoning tree.
Properties
activeNodes
readonly activeNodes: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:135
Number of currently active nodes
avgBranchingFactor
readonly avgBranchingFactor: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:147
Average branching factor
avgConfidence
readonly avgConfidence: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:141
Average node confidence
avgQualityScore
readonly avgQualityScore: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:139
Average node quality score
conclusionCount
readonly conclusionCount: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:143
Number of conclusion nodes
maxDepth
readonly maxDepth: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:137
Maximum depth reached
totalNodes
readonly totalNodes: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:133
Total number of nodes in the tree
totalTokensUsed
readonly totalTokensUsed: number;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:145
Total tokens used across all nodes
TrinityConfig
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:170
Configuration for TRINITY coordinator.
Properties
includeHistory?
readonly optional includeHistory?: boolean;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:176
Whether to include detailed phase history
maxIterations?
readonly optional maxIterations?: number;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:172
Maximum verification iterations before giving up
roleConfigs?
readonly optional roleConfigs?: Partial<Record<TrinityRole, Partial<TrinityRoleConfig>>>;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:178
Custom role configurations
timeoutMs?
readonly optional timeoutMs?: number;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:174
Timeout for entire coordination in ms
TrinityExecuteOptions
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:253
Options for executing TRINITY coordination.
Properties
agent
readonly agent: IAgent;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:255
task
readonly task: Task;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:254
TrinityPhaseResult
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:105
Result from a single TRINITY phase.
Properties
durationMs
readonly durationMs: number;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:113
Duration in milliseconds
output
readonly output: string;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:111
Output from the phase
phase
readonly phase: TrinityPhase;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:107
Which phase produced this result
role
readonly role: TrinityRole;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:109
Role that executed this phase
tokensMeasured?
readonly optional tokensMeasured?: boolean;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:124
Whether tokensUsed is a measurement (#4743).
false means the adapter reported no usage, so tokensUsed is a
placeholder zero rather than a count. Absent means the producer predates
the distinction — unknown, not measured. Additive and optional, so no
existing reader breaks.
tokensUsed
readonly tokensUsed: number;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:115
Tokens used. Meaningful only when tokensMeasured is not false.
TrinityResult
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:194
Result of TRINITY coordination.
Properties
finalOutput
readonly finalOutput: string;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:198
Final output after all phases
history
readonly history: TrinityPhaseResult[];
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:210
Phase execution history
iterations
readonly iterations: number;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:206
Number of think-work-verify iterations
stopReason
readonly stopReason: "error" | "timeout" | "verified" | "max_iterations";
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:212
Stop reason
success
readonly success: boolean;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:196
Whether coordination succeeded
thinkerOutput
readonly thinkerOutput: ThinkerOutput;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:200
Thinker’s analysis
totalDurationMs
readonly totalDurationMs: number;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:208
Total duration in milliseconds
verifierOutput
readonly verifierOutput: VerifierOutput;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:204
Verifier’s final assessment
workerOutput
readonly workerOutput: WorkerOutput;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:202
Worker’s implementation
TrinityRoleConfig
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:23
Configuration for a TRINITY role.
Properties
maxTokens
readonly maxTokens: number;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:31
Maximum tokens for response
role
readonly role: TrinityRole;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:25
Role identifier
systemPrompt
readonly systemPrompt: string;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:27
System prompt for this role
temperature
readonly temperature: number;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:29
Temperature for completions
VerifierOutput
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:152
Verifier’s evaluation output.
Properties
correctnessCheck
readonly correctnessCheck: string;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:156
Correctness assessment
issuesFound
readonly issuesFound: string[];
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:160
Issues found
qualityCheck
readonly qualityCheck: string;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:158
Quality assessment
recommendations
readonly recommendations: string[];
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:162
Recommendations
verdict
readonly verdict: "pass" | "fail";
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:154
Pass or fail verdict
VoteMessage
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:164
Vote message for consensus protocol.
Properties
conditions?
optional conditions?: string[];
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:169
decision
decision: VoteDecision;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:167
expertId
expertId: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:166
reasoning
reasoning: string;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:168
type
type: "vote";
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:165
Vulnerability
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:85
Represents a security vulnerability.
Properties
cweId?
optional cweId?: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:99
CWE reference if applicable
description
description: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:93
Description of the vulnerability
id
id: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:87
Unique vulnerability ID
location?
optional location?: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:95
Affected location
remediation
remediation: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:97
Remediation steps
severity
severity: "critical" | "info" | "high" | "low" | "medium";
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:89
Severity level
type
type: string;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:91
Vulnerability type (OWASP category)
WaveExecutionResult
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:127
Final result of the full wave execution.
Properties
aborted
readonly aborted: boolean;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:137
Whether execution was aborted early (budget exceeded or failure).
abortReason?
readonly optional abortReason?: string;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:139
Reason for abort, if aborted.
allResults
readonly allResults: readonly WaveTaskResult[];
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:131
All task results flat.
totalDurationMs
readonly totalDurationMs: number;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:135
Total duration in ms.
totalTokensUsed
readonly totalTokensUsed: number;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:133
Total estimated tokens consumed across all waves.
waves
readonly waves: readonly WaveResult[];
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:129
Results organized by wave.
WaveResult
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:113
Result of executing a single wave.
Properties
durationMs
readonly durationMs: number;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:121
Total duration of this wave in ms.
results
readonly results: readonly WaveTaskResult[];
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:117
Results of all tasks in this wave.
totalTokens
readonly totalTokens: number;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:119
Total estimated tokens consumed by this wave.
waveIndex
readonly waveIndex: number;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:115
The wave index (0-based).
WaveSchedulerConfig
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:19
Configuration for the wave scheduler.
Properties
abortOnFailure
readonly abortOnFailure: boolean;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:35
Whether to abort remaining waves on first task failure. Default: false.
maxConcurrency
readonly maxConcurrency: number;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:21
Maximum number of tasks to execute concurrently in one wave. Default: 4.
maxOutputChars
readonly maxOutputChars: number;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:23
Maximum output length (chars) per task result. Default: 2000.
maxTotalTokens
readonly maxTotalTokens: number;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:33
Maximum total token budget across all waves. 0 = unlimited. Default: 0.
Enforced against the SUM OF ESTIMATES described on
WaveTaskResult.estimatedTokens, which excludes input tokens and counts a
failed task as zero. Both errors run in the same direction: the budget
believes it has more headroom than it does, so enabling this does not give
you a reliable spend cap (#4761).
onWaveComplete?
readonly optional onWaveComplete?: (waveIndex, results, cumulativeTokens) => Promise<void>;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:39
Optional callback invoked after each wave completes. Used for checkpointing.
Parameters
waveIndex
number
results
readonly WaveTaskResult[]
cumulativeTokens
number
Returns
Promise<void>
taskTimeoutMs
readonly taskTimeoutMs: number;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:37
Timeout per individual task in ms. Default: 60000.
WaveTask
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:65
A task to be executed in a wave.
Type Parameters
T
T = unknown
Properties
dependencies
readonly dependencies: readonly string[];
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:73
IDs of tasks that must complete before this one can start.
description
readonly description: string;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:69
Human-readable description of what this task does.
id
readonly id: string;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:67
Unique identifier for this task.
input
readonly input: T;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:71
The input data for this task.
WaveTaskResult
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:79
Result of a single task execution.
Properties
durationMs
readonly durationMs: number;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:105
Duration of this task in ms.
error?
readonly optional error?: string;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:107
Error message if task failed.
estimatedTokens
readonly estimatedTokens: number;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:103
Rough token estimate for this task, derived as outputChars / 4 (#4761).
NOT a measurement, and specifically NOT comparable to
ResultMetadata.tokensUsed:
- Input is not counted. Prompt and context usually dominate an agent task’s spend, so a large prompt with a terse answer looks nearly free.
- A failed task reports 0, however long it ran before throwing.
Real usage is not available here: WaveTaskExecutor returns a bare string,
so the scheduler has nothing better to sum. Treat this as a coarse
output-size signal, not a spend figure.
originalLength
readonly originalLength: number;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:89
Original output length before truncation.
output
readonly output: string;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:85
The output text (truncated to maxOutputChars).
success
readonly success: boolean;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:83
Whether the task completed successfully.
taskId
readonly taskId: string;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:81
Task ID this result belongs to.
truncated
readonly truncated: boolean;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:87
Whether the output was truncated.
WorkChunk
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:149
A chunk of work produced by auto-chunking.
Properties
id
readonly id: string;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:151
Unique ID for this chunk.
items
readonly items: readonly string[];
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:155
Items in this chunk (e.g., file paths).
scope
readonly scope: string;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:153
Scope description (e.g., directory path).
WorkerOutput
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:140
Worker’s implementation output.
Properties
deviations
readonly deviations: string[];
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:146
Deviations from plan
implementation
readonly implementation: string;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:142
The actual implementation/content
questions
readonly questions: string[];
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:148
Questions or blockers
stepsCompleted
readonly stepsCompleted: string[];
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:144
Steps completed
Type Aliases
ActivationStrategy
type ActivationStrategy = "ucb" | "greedy" | "diverse" | "adaptive";
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:25
Strategy for selecting which nodes to activate.
ucb: Upper Confidence Bound (exploration/exploitation balance)greedy: Always activate highest-scoring nodesdiverse: Prioritize diversity across treesadaptive: Dynamically adjust based on progress
AgentStopReason
type AgentStopReason = "agent-stopped" | "turn-budget" | "tool-error" | "cancelled";
Defined in: packages/nexus-agents/src/agents/agentic/types.ts:72
Why the agent loop stopped.
agent-stopped: model emitted no further tool calls — natural endturn-budget: hitturnBudgetbefore the model finishedtool-error:onToolCallthrew; harness’s responsibility to gradecancelled: externalAbortSignalfired
AggregationStrategy
type AggregationStrategy = "merge" | "select_best" | "consensus" | "sequential_chain";
Defined in: packages/nexus-agents/src/agents/collaboration/aggregator-types.ts:19
Aggregation strategy types.
ArchitectureStyle
type ArchitectureStyle =
| "layered"
| "microservices"
| "event_driven"
| "hexagonal"
| "clean"
| "cqrs"
| "ddd";
Defined in: packages/nexus-agents/src/agents/experts/architecture-expert.ts:52
Architecture style options.
BuiltInExpertType
type BuiltInExpertType =
| "code"
| "architecture"
| "security"
| "documentation"
| "testing"
| "devops"
| "research"
| "pm"
| "ux"
| "infrastructure"
| "qa"
| "data-visualization";
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:70
Built-in expert type identifiers.
CollaborationMessage
type CollaborationMessage =
| TaskAssignmentMessage
| ResultSubmissionMessage
| ReviewRequestMessage
| ReviewResponseMessage
| FeedbackMessage
| VoteMessage
| StatusUpdateMessage;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:93
Collaboration message types for inter-expert communication.
CollaborationPattern
type CollaborationPattern =
| "sequential"
| "parallel"
| "review"
| "consensus"
| "reflexion"
| "aegean"
| "self-refine"
| "self-debug";
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:36
Collaboration pattern types.
- sequential: Experts work in order, passing results forward
- parallel: Experts work simultaneously on the same task
- review: One expert reviews another’s work
- consensus: Voting-based decision making
- reflexion: Multi-agent reflexion with persona-based critics (arxiv:2512.20845)
- aegean: Byzantine-fault-tolerant consensus (arxiv:2512.20184)
- self-refine: Iterative refinement with self-feedback (arxiv:2303.17651)
- self-debug: Automatic error detection and repair (arxiv:2304.05128)
ConflictResolver
type ConflictResolver = (conflict, result1, result2) => "expert1" | "expert2" | "merged";
Defined in: packages/nexus-agents/src/agents/collaboration/aggregator-types.ts:34
Conflict resolver function type.
Parameters
conflict
result1
result2
Returns
"expert1" | "expert2" | "merged"
ContentPriority
type ContentPriority = typeof ContentPriority[keyof typeof ContentPriority];
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:13
Priority levels for context content. Higher priority content is retained longer during pruning.
CrossTreeStrategy
type CrossTreeStrategy = "none" | "conclusions" | "insights" | "full";
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:40
Strategy for sharing information across trees.
none: No cross-tree sharingconclusions: Share only conclusionsinsights: Share conclusions and intermediate insightsfull: Share all relevant information
ExpertCollaborationPatternType
type ExpertCollaborationPatternType = typeof ExpertCollaborationPattern[keyof typeof ExpertCollaborationPattern];
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:28
Agents exports - Agent framework, Orchestrator, Experts Split from index.ts for file size compliance (Issue #285)
ExpertDomain
type ExpertDomain = "code" | "security" | "architecture" | "testing" | "documentation";
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:28
Expert domain categories.
ExplorationEventType
type ExplorationEventType =
| "tree_created"
| "node_created"
| "node_activated"
| "node_deactivated"
| "node_completed"
| "node_pruned"
| "path_scored"
| "cross_tree_share"
| "conclusion_reached"
| "tree_completed"
| "forest_converging"
| "forest_completed";
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:89
Types of exploration events.
FailureClassification
type FailureClassification = {
archetype?: FailureArchetype;
confidence?: number;
kind: "transient" | "permanent";
source: "transport" | "archetype" | "default";
};
Defined in: packages/nexus-agents/src/agents/experts/expert-recovery.ts:115
The outcome of classifying a single failed execution attempt.
transient: retry (transport error, or a recoverable behavioral archetype)permanent: fail closed (cancelled, non-retryable, or a terminal archetype)
Properties
archetype?
optional archetype?: FailureArchetype;
Defined in: packages/nexus-agents/src/agents/experts/expert-recovery.ts:118
confidence?
optional confidence?: number;
Defined in: packages/nexus-agents/src/agents/experts/expert-recovery.ts:119
kind
kind: "transient" | "permanent";
Defined in: packages/nexus-agents/src/agents/experts/expert-recovery.ts:116
source
source: "transport" | "archetype" | "default";
Defined in: packages/nexus-agents/src/agents/experts/expert-recovery.ts:117
ForestId
type ForestId = string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:30
Unique identifier for a forest (collection of trees).
ForestPruningStrategy
type ForestPruningStrategy = "none" | "score" | "depth" | "combined";
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:55
Strategy for pruning low-quality branches.
none: No pruningscore: Prune nodes below score thresholddepth: Prune based on depth limitscombined: Use both score and depth criteria
ForestState
type ForestState = "initializing" | "exploring" | "converging" | "completed" | "timeout";
Defined in: packages/nexus-agents/src/agents/reasoning/forest-state-types.ts:28
State of a forest of reasoning trees.
initializing: Forest is being set upexploring: Actively exploring treesconverging: Trees are converging on solution(s)completed: Forest has finished explorationtimeout: Exploration ended due to timeout
NodeId
type NodeId = string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:20
Unique identifier for a reasoning node.
NodeState
type NodeState = "pending" | "active" | "completed" | "pruned" | "error";
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:45
State of a reasoning node in its lifecycle.
pending: Node created but not yet processedactive: Node currently being explored/evaluatedcompleted: Node exploration finished successfullypruned: Node was pruned due to low score or depth limiterror: Node exploration failed with an error
PruningStrategy
type PruningStrategy = typeof PruningStrategy[keyof typeof PruningStrategy];
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:41
Strategy for pruning context when budget is exceeded.
QualityAttribute
type QualityAttribute =
| "performance"
| "scalability"
| "maintainability"
| "security"
| "reliability"
| "testability";
Defined in: packages/nexus-agents/src/agents/experts/architecture-expert.ts:58
Quality attributes for architecture decisions.
QualityScorer
type QualityScorer = (results, aggregatedOutput) => number;
Defined in: packages/nexus-agents/src/agents/collaboration/aggregator-types.ts:43
Quality scorer function type.
Parameters
results
aggregatedOutput
unknown
Returns
number
ReasoningStepType
type ReasoningStepType =
| "hypothesis"
| "inference"
| "decomposition"
| "synthesis"
| "verification"
| "conclusion";
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:62
Type of reasoning step represented by a node.
hypothesis: Initial hypothesis or assumptioninference: Logical deduction from parent node(s)decomposition: Breaking down a complex problemsynthesis: Combining multiple reasoning pathsverification: Validating a previous stepconclusion: Final answer or decision
SecurityFocusArea
type SecurityFocusArea =
| "authentication"
| "authorization"
| "input_validation"
| "cryptography"
| "injection"
| "secrets"
| "dependencies";
Defined in: packages/nexus-agents/src/agents/experts/security-expert.ts:54
Security focus areas for targeted analysis.
SessionEvent
type SessionEvent =
| {
status: SessionStatus;
type: "status_change";
}
| {
expertId: string;
type: "expert_joined";
}
| {
expertId: string;
result: TaskResult;
type: "result_submitted";
}
| {
approved: boolean;
reviewerId: string;
type: "review_completed";
}
| {
decision: string;
expertId: string;
type: "vote_received";
}
| {
expertId?: string;
type: "timeout";
}
| {
error: Error;
type: "error";
};
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session-helpers.ts:29
Session event types for callbacks.
SessionStatus
type SessionStatus =
| "pending"
| "in_progress"
| "awaiting_review"
| "voting"
| "finalizing"
| "completed"
| "failed"
| "timed_out";
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:49
Session status during collaboration lifecycle.
StateChangeCallback
type StateChangeCallback = (transition) => void;
Defined in: packages/nexus-agents/src/agents/state-machine-types.ts:43
Callback for state change events.
Parameters
transition
Returns
void
StateTransitionEvent
type StateTransitionEvent =
| "task_assigned"
| "plan_completed"
| "needs_input"
| "task_completed"
| "failure"
| "input_received"
| "recovered";
Defined in: packages/nexus-agents/src/agents/state-machine-types.ts:15
State transition event types.
SubtaskPriority
type SubtaskPriority = "critical" | "high" | "medium" | "low";
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:16
Subtask priority levels.
SubtaskStatus
type SubtaskStatus = "pending" | "assigned" | "in_progress" | "completed" | "failed";
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:21
Subtask status.
TerminationReason
type TerminationReason =
| "solution_found"
| "convergence"
| "max_time"
| "max_tokens"
| "max_depth"
| "no_progress"
| "error";
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:26
Termination reason for forest exploration.
TransitionErrorCallback
type TransitionErrorCallback = (currentState, attemptedEvent, error) => void;
Defined in: packages/nexus-agents/src/agents/state-machine-types.ts:48
Error callback for invalid transitions.
Parameters
currentState
attemptedEvent
error
Returns
void
TreeId
type TreeId = string;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:25
Unique identifier for a reasoning tree.
TreeState
type TreeState = "growing" | "paused" | "completed" | "abandoned";
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:26
State of a reasoning tree.
growing: Tree is actively being exploredpaused: Tree exploration temporarily pausedcompleted: Tree has reached conclusion(s)abandoned: Tree was abandoned (low quality or pruned)
TrinityPhase
type TrinityPhase = "thinking" | "working" | "verifying" | "complete";
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:102
Phase of TRINITY coordination.
TrinityRole
type TrinityRole = "thinker" | "worker" | "verifier";
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:20
TRINITY-specific roles.
VoteDecision
type VoteDecision = "approve" | "reject" | "abstain";
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-types.ts:62
Vote decision options for consensus protocol.
WaveTaskExecutor
type WaveTaskExecutor<T> = (task) => Promise<string>;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:162
Executor function that processes a single WaveTask. Returns the output string (which will be truncated by the scheduler).
Type Parameters
T
T = unknown
Parameters
task
WaveTask<T>
Returns
Promise<string>
Variables
ActivationStrategySchema
const ActivationStrategySchema: ZodEnum<{
adaptive: "adaptive";
diverse: "diverse";
greedy: "greedy";
ucb: "ucb";
}>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:30
Schema for ActivationStrategy validation.
AgentMessageSchema
const AgentMessageSchema: ZodObject<{
from: ZodString;
id: ZodString;
payload: ZodUnknown;
timestamp: ZodString;
to: ZodString;
type: ZodEnum<{
feedback: "feedback";
query: "query";
result: "result";
status: "status";
task: "task";
}>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/agent-schemas.ts:54
Zod schema for validating AgentMessage objects.
BaseAgentOptionsSchema
const BaseAgentOptionsSchema: ZodObject<{
capabilities: ZodArray<ZodEnum<{
code_generation: "code_generation";
code_review: "code_review";
collaboration: "collaboration";
delegation: "delegation";
research: "research";
task_execution: "task_execution";
tool_use: "tool_use";
}>>;
contextPruning: ZodOptional<ZodObject<{
enabled: ZodOptional<ZodBoolean>;
maxTokens: ZodOptional<ZodNumber>;
reserveTokens: ZodOptional<ZodNumber>;
strategy: ZodOptional<ZodEnum<{
hierarchical: "hierarchical";
lowest_priority: "lowest_priority";
oldest_first: "oldest_first";
priority_weighted_age: "priority_weighted_age";
semantic: "semantic";
sliding_window: "sliding_window";
summarize: "summarize";
}>>;
triggerThreshold: ZodOptional<ZodNumber>;
}, $strip>>;
id: ZodString;
maxTokens: ZodOptional<ZodNumber>;
role: ZodEnum<{
architecture_expert: "architecture_expert";
code_expert: "code_expert";
custom: "custom";
data_visualization_expert: "data_visualization_expert";
devops_expert: "devops_expert";
documentation_expert: "documentation_expert";
infrastructure_expert: "infrastructure_expert";
orchestrator: "orchestrator";
pm_expert: "pm_expert";
qa_expert: "qa_expert";
research_expert: "research_expert";
security_expert: "security_expert";
testing_expert: "testing_expert";
thinker: "thinker";
ux_expert: "ux_expert";
verifier: "verifier";
worker: "worker";
}>;
systemPrompt: ZodOptional<ZodString>;
temperature: ZodOptional<ZodNumber>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/agent-schemas.ts:93
Zod schema for validating BaseAgentOptions.
BestSolutionSchema
const BestSolutionSchema: ZodObject<{
combinedScore: ZodNumber;
conclusionNode: ZodObject<{
activationScore: ZodNumber;
children: ZodArray<ZodString>;
confidence: ZodNumber;
content: ZodString;
createdAt: ZodNumber;
depth: ZodNumber;
estimatedValue: ZodNumber;
id: ZodString;
isActive: ZodBoolean;
metadata: ZodObject<{
crossReferences: ZodOptional<ZodArray<ZodString>>;
custom: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
generationTimeMs: ZodOptional<ZodNumber>;
source: ZodOptional<ZodString>;
tokensUsed: ZodOptional<ZodNumber>;
}, $strip>;
parentId: ZodNullable<ZodString>;
qualityScore: ZodNumber;
state: ZodEnum<{
active: "active";
completed: "completed";
error: "error";
pending: "pending";
pruned: "pruned";
}>;
stepType: ZodEnum<{
conclusion: "conclusion";
decomposition: "decomposition";
hypothesis: "hypothesis";
inference: "inference";
synthesis: "synthesis";
verification: "verification";
}>;
treeId: ZodString;
updatedAt: ZodNumber;
}, $strip>;
confidence: ZodNumber;
path: ZodArray<ZodString>;
qualityScore: ZodNumber;
treeId: ZodString;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:73
Schema for BestSolution validation.
BUILT_IN_EXPERTS
const BUILT_IN_EXPERTS: Readonly<Record<BuiltInExpertType, ExpertConfig>>;
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:195
Built-in expert configurations. These provide sensible defaults for common expert types.
MIRROR of agents/<name>-expert.md, which is repo-only and NOT shipped —
package.json#files lists dist, two src/ asset dirs and the README, so an
installed package has no agents/ directory. The runtime reads this constant,
never those files, which is why the omission is correct rather than a bug
(#5143).
GATED BY scripts/generate-agents-index.ts --check, which fails when an
expert exists in one place and not the other. Without that gate this constant
and its source documents would drift silently, and the drift would only be
visible to someone reading both.
BuiltInExpertTypeSchema
const BuiltInExpertTypeSchema: ZodEnum<{
architecture: "architecture";
code: "code";
data-visualization: "data-visualization";
devops: "devops";
documentation: "documentation";
infrastructure: "infrastructure";
pm: "pm";
qa: "qa";
research: "research";
security: "security";
testing: "testing";
ux: "ux";
}>;
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:165
Zod schema for BuiltInExpertType.
MUST stay in lockstep with the BuiltInExpertType type union above.
Tested by BuiltInExpertTypeSchema accepts every literal in BuiltInExpertType
in expert-config.test.ts to prevent drift (#2338).
CodeChangeSchema
const CodeChangeSchema: ZodObject<{
description: ZodString;
file: ZodString;
lineRange: ZodOptional<ZodObject<{
end: ZodNumber;
start: ZodNumber;
}, $strip>>;
modified: ZodString;
original: ZodOptional<ZodString>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:292
Code change schema.
CollaborationConfigSchema
const CollaborationConfigSchema: ZodObject<{
experts: ZodArray<ZodString>;
maxRetries: ZodOptional<ZodNumber>;
minVotes: ZodOptional<ZodNumber>;
pattern: ZodEnum<{
aegean: "aegean";
consensus: "consensus";
parallel: "parallel";
reflexion: "reflexion";
review: "review";
self-debug: "self-debug";
self-refine: "self-refine";
sequential: "sequential";
}>;
requireUnanimous: ZodOptional<ZodBoolean>;
sessionId: ZodString;
task: ZodObject<{
constraints: ZodOptional<ZodObject<{
allowedTools: ZodOptional<ZodArray<ZodString>>;
maxDuration: ZodOptional<ZodNumber>;
maxTokens: ZodOptional<ZodNumber>;
outputFormat: ZodOptional<ZodEnum<{
json: "json";
markdown: "markdown";
text: "text";
}>>;
}, $strip>>;
context: ZodRecord<ZodString, ZodUnknown>;
description: ZodString;
id: ZodString;
priority: ZodOptional<ZodNumber>;
}, $strip>;
timeout: ZodOptional<ZodNumber>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-schemas.ts:45
Zod schema for CollaborationConfig.
CollaborationPatternSchema
const CollaborationPatternSchema: ZodEnum<{
aegean: "aegean";
consensus: "consensus";
parallel: "parallel";
reflexion: "reflexion";
review: "review";
self-debug: "self-debug";
self-refine: "self-refine";
sequential: "sequential";
}>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-schemas.ts:12
Zod schema for CollaborationPattern.
ContentPriority
const ContentPriority: {
ACTIVE: 60;
EPHEMERAL: 20;
HISTORY: 40;
SYSTEM: 100;
TASK: 80;
};
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:13
Priority levels for context content. Higher priority content is retained longer during pruning.
Type Declaration
ACTIVE
readonly ACTIVE: 60 = 60;
Active working content (recent code, research)
EPHEMERAL
readonly EPHEMERAL: 20 = 20;
Ephemeral content (debug logs, temp data)
HISTORY
readonly HISTORY: 40 = 40;
Historical context (older messages, results)
SYSTEM
readonly SYSTEM: 100 = 100;
System instructions - highest priority, never pruned
TASK
readonly TASK: 80 = 80;
Current task description and requirements
ContextBudgetSchema
const ContextBudgetSchema: ZodObject<{
active: ZodNumber;
reserved: ZodNumber;
system: ZodNumber;
task: ZodNumber;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:56
Zod schema for ContextBudget validation.
ContextManagerConfigSchema
const ContextManagerConfigSchema: ZodObject<{
budget: ZodOptional<ZodObject<{
active: ZodNumber;
reserved: ZodNumber;
system: ZodNumber;
task: ZodNumber;
}, $strip>>;
maxTokens: ZodNumber;
warningThreshold: ZodOptional<ZodNumber>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:111
Schema for ContextManagerConfig validation.
ContextPrunerConfigSchema
const ContextPrunerConfigSchema: ZodObject<{
autoTriggerThreshold: ZodOptional<ZodNumber>;
defaultStrategy: ZodOptional<ZodEnum<{
hierarchical: "hierarchical";
lowest_priority: "lowest_priority";
oldest_first: "oldest_first";
priority_weighted_age: "priority_weighted_age";
semantic: "semantic";
sliding_window: "sliding_window";
summarize: "summarize";
}>>;
minItemsPerCategory: ZodOptional<ZodNumber>;
protectedPriority: ZodOptional<ZodNumber>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:64
Agents exports - Agent framework, Orchestrator, Experts Split from index.ts for file size compliance (Issue #285)
CoverageMetricsSchema
const CoverageMetricsSchema: ZodObject<{
branch: ZodNumber;
function: ZodNumber;
line: ZodNumber;
statement: ZodNumber;
uncoveredAreas: ZodOptional<ZodArray<ZodString>>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:319
Coverage metrics schema.
CrossTreeInfoSchema
const CrossTreeInfoSchema: ZodObject<{
failurePatterns: ZodArray<ZodObject<{
avgFailureScore: ZodNumber;
occurrences: ZodNumber;
pattern: ZodString;
}, $strip>>;
sharedConclusions: ZodArray<ZodObject<{
confidence: ZodNumber;
content: ZodString;
qualityScore: ZodNumber;
sourceNodeId: ZodString;
sourceTreeId: ZodString;
}, $strip>>;
sharedInsights: ZodArray<ZodObject<{
content: ZodString;
relevance: ZodNumber;
sourceNodeId: ZodString;
sourceTreeId: ZodString;
}, $strip>>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:119
Schema for CrossTreeInfo validation.
CrossTreeStrategySchema
const CrossTreeStrategySchema: ZodEnum<{
conclusions: "conclusions";
full: "full";
insights: "insights";
none: "none";
}>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:45
Schema for CrossTreeStrategy validation.
DEFAULT_ACTIVATION_OPTIONS
const DEFAULT_ACTIVATION_OPTIONS: ActivationOptions;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:204
Default activation options.
DEFAULT_BUDGET
const DEFAULT_BUDGET: ContextBudget;
Defined in: packages/nexus-agents/src/agents/context-manager-types.ts:46
Default budget allocation percentages.
DEFAULT_FOREST_CONFIG
const DEFAULT_FOREST_CONFIG: ForestConfig;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:154
Default Forest-of-Thought configuration.
DEFAULT_MAX_RETRIES
const DEFAULT_MAX_RETRIES: 2 = 2;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-schemas.ts:130
Default retry counts.
DEFAULT_PATH_SCORING_OPTIONS
const DEFAULT_PATH_SCORING_OPTIONS: PathScoringOptions;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:116
Default path scoring options.
DEFAULT_TIMEOUTS
const DEFAULT_TIMEOUTS: {
aegean: number;
consensus: number;
parallel: number;
reflexion: number;
review: number;
self-debug: number;
self-refine: number;
sequential: number;
};
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-schemas.ts:116
Default collaboration timeouts.
Type Declaration
aegean
readonly aegean: number;
consensus
readonly consensus: number;
parallel
readonly parallel: number;
reflexion
readonly reflexion: number;
review
readonly review: number;
self-debug
readonly self-debug: number;
self-refine
readonly self-refine: number;
sequential
readonly sequential: number;
DEFAULT_TRINITY_CONFIG
const DEFAULT_TRINITY_CONFIG: Required<TrinityConfig>;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:182
Default TRINITY configuration.
DEFAULT_WAVE_CONFIG
const DEFAULT_WAVE_CONFIG: WaveSchedulerConfig;
Defined in: packages/nexus-agents/src/agents/wave-scheduler-types.ts:50
Default wave scheduler configuration. Matches CLAUDE.md guidelines: waves of 3-4, 2000 char output budget.
EXPERT_CAPABILITIES
const EXPERT_CAPABILITIES: Readonly<Record<AgentRole, readonly string[]>>;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:354
Expert role capabilities mapping. Maps each expert role to their core capabilities.
EXPERT_DEFAULT_CAPABILITIES
const EXPERT_DEFAULT_CAPABILITIES: Record<AgentRole, readonly AgentCapability[]>;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:341
Default capabilities for each expert role.
EXPERT_DEFAULT_TEMPERATURES
const EXPERT_DEFAULT_TEMPERATURES: Record<ExpertDomain, number>;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:330
Default temperatures for each expert domain.
EXPERT_TYPE_TO_ROLE
const EXPERT_TYPE_TO_ROLE: Readonly<Record<BuiltInExpertType, AgentRole>>;
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:589
Maps built-in expert types to their AgentRole.
ExpertAssignmentSchema
const ExpertAssignmentSchema: ZodObject<{
confidence: ZodNumber;
expertRole: ZodEnum<{
architecture_expert: "architecture_expert";
code_expert: "code_expert";
custom: "custom";
devops_expert: "devops_expert";
documentation_expert: "documentation_expert";
infrastructure_expert: "infrastructure_expert";
orchestrator: "orchestrator";
pm_expert: "pm_expert";
research_expert: "research_expert";
security_expert: "security_expert";
testing_expert: "testing_expert";
ux_expert: "ux_expert";
}>;
ictmConfig: ZodOptional<ZodObject<{
context: ZodObject<{
includeHistory: ZodBoolean;
maxTokens: ZodNumber;
pruneStrategy: ZodEnum<{
hybrid: "hybrid";
importance: "importance";
recency: "recency";
}>;
relevanceThreshold: ZodNumber;
}, $strip>;
instructions: ZodString;
metadata: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
model: ZodObject<{
maxTokens: ZodOptional<ZodNumber>;
modelId: ZodOptional<ZodString>;
provider: ZodOptional<ZodString>;
reasoning: ZodOptional<ZodEnum<{
extended: "extended";
minimal: "minimal";
standard: "standard";
}>>;
temperature: ZodOptional<ZodNumber>;
}, $strip>;
tools: ZodObject<{
capabilities: ZodArray<ZodString>;
restrictions: ZodOptional<ZodArray<ZodString>>;
}, $strip>;
}, $strip>>;
selectionReason: ZodString;
subtaskId: ZodString;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:276
Zod schema for ExpertAssignment.
ExpertCollaborationPattern
const ExpertCollaborationPattern: {
PAIR: "pair";
PARALLEL: "parallel";
REVIEW_CHAIN: "review_chain";
SEQUENTIAL: "sequential";
};
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:21
Collaboration patterns for multi-expert tasks.
Type Declaration
PAIR
readonly PAIR: "pair" = 'pair';
PARALLEL
readonly PARALLEL: "parallel" = 'parallel';
REVIEW_CHAIN
readonly REVIEW_CHAIN: "review_chain" = 'review_chain';
SEQUENTIAL
readonly SEQUENTIAL: "sequential" = 'sequential';
ExpertConfigSchema
const ExpertConfigSchema: ZodObject<{
capabilities: ZodArray<ZodEnum<{
code_generation: "code_generation";
code_review: "code_review";
collaboration: "collaboration";
delegation: "delegation";
research: "research";
task_execution: "task_execution";
tool_use: "tool_use";
}>>;
id: ZodString;
metadata: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
modelPreference: ZodOptional<ZodObject<{
maxTokens: ZodOptional<ZodNumber>;
modelId: ZodOptional<ZodString>;
provider: ZodOptional<ZodString>;
temperature: ZodOptional<ZodNumber>;
}, $strip>>;
name: ZodString;
role: ZodEnum<{
architecture_expert: "architecture_expert";
code_expert: "code_expert";
custom: "custom";
data_visualization_expert: "data_visualization_expert";
devops_expert: "devops_expert";
documentation_expert: "documentation_expert";
infrastructure_expert: "infrastructure_expert";
orchestrator: "orchestrator";
pm_expert: "pm_expert";
qa_expert: "qa_expert";
research_expert: "research_expert";
security_expert: "security_expert";
testing_expert: "testing_expert";
ux_expert: "ux_expert";
}>;
systemPrompt: ZodString;
toolRestrictions: ZodOptional<ZodObject<{
allowedTools: ZodOptional<ZodArray<ZodString>>;
deniedTools: ZodOptional<ZodArray<ZodString>>;
}, $strip>>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:147
Agents exports - Agent framework, Orchestrator, Experts Split from index.ts for file size compliance (Issue #285)
ExpertDomainSchema
const ExpertDomainSchema: ZodEnum<{
architecture: "architecture";
code: "code";
documentation: "documentation";
security: "security";
testing: "testing";
}>;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:241
Expert domain schema.
ExpertFactory
const ExpertFactory: {
create: (config, options?) => Result<Expert, FactoryError>;
createAllBuiltIn: (options?) => Result<Expert[], FactoryError>;
createBuiltIn: (type, options?) => Result<Expert, FactoryError>;
createFromICTM: (ictm, subtaskId, options?) => Result<Expert, FactoryError>;
createMany: (configs, options?) => Result<Expert[], FactoryError>;
getBuiltInConfig: (type) => Result<ExpertConfig, FactoryError>;
validate: (config) => Result<ExpertConfig, FactoryError>;
};
Defined in: packages/nexus-agents/src/agents/experts/expert-factory.ts:429
Factory namespace for creating expert agents. Provides static methods for backward compatibility.
Type Declaration
create
readonly create: (config, options?) => Result<Expert, FactoryError> = createExpert;
Create an expert agent from a configuration object.
Parameters
config
Expert configuration
options?
Creation options including adapter
Returns
Result with Expert or FactoryError
Example
const config: ExpertConfig = {
id: 'my-expert',
name: 'My Expert',
role: 'code_expert',
capabilities: ['task_execution'],
systemPrompt: 'You are a code review expert.',
};
const result = createExpert(config, { adapter: myAdapter });
if (result.ok) {
const expert = result.value;
}
createAllBuiltIn
readonly createAllBuiltIn: (options?) => Result<Expert[], FactoryError> = createAllBuiltInExperts;
Create all built-in experts.
Parameters
options?
Creation options applied to all experts
Returns
Result<Expert[], FactoryError>
Result with array of all built-in Experts
createBuiltIn
readonly createBuiltIn: (type, options?) => Result<Expert, FactoryError> = createBuiltInExpert;
Create a built-in expert by type.
Built-in types include: ‘code’, ‘architecture’, ‘security’, ‘documentation’, and ‘testing’.
Parameters
type
Built-in expert type
options?
Creation options including adapter
Returns
Result with Expert or FactoryError
Example
const result = createBuiltInExpert('security', { adapter: myAdapter });
if (result.ok) {
const securityExpert = result.value;
}
createFromICTM
createFromICTM: (ictm, subtaskId, options?) => Result<Expert, FactoryError>;
Create an expert agent from an ICTM configuration (Issue #756).
Bridges the ICTM pattern to the existing expert factory by converting the ICTM config to an ExpertConfig and delegating to createExpert().
Parameters
ictm
ICTM configuration with instructions, context, tools, model
subtaskId
string
Subtask identifier used for naming
options?
Creation options including adapter
Returns
Result with Expert or FactoryError
createMany
readonly createMany: (configs, options?) => Result<Expert[], FactoryError> = createManyExperts;
Create multiple experts from configurations.
Parameters
configs
Array of expert configurations
options?
Creation options applied to all experts
Returns
Result<Expert[], FactoryError>
Result with array of Experts or first FactoryError
getBuiltInConfig
readonly getBuiltInConfig: (type) => Result<ExpertConfig, FactoryError> = getBuiltInExpertConfig;
Get the configuration for a built-in expert type.
Parameters
type
Built-in expert type
Returns
Result<ExpertConfig, FactoryError>
Result with config or FactoryError if type invalid
validate
readonly validate: (config) => Result<ExpertConfig, FactoryError> = validateExpertConfigStrict;
Validate a configuration without creating an expert.
Parameters
config
unknown
Configuration to validate
Returns
Result<ExpertConfig, FactoryError>
Result with validated config or FactoryError
ExpertMatchSchema
const ExpertMatchSchema: ZodObject<{
expertId: ZodString;
matchedCapabilities: ZodArray<ZodString>;
reasoning: ZodString;
score: ZodNumber;
scoreBreakdown: ZodObject<{
capabilityScore: ZodNumber;
domainScore: ZodNumber;
finalScore: ZodNumber;
weightScore: ZodNumber;
}, $strip>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:128
Agents exports - Agent framework, Orchestrator, Experts Split from index.ts for file size compliance (Issue #285)
ExpertOptionsSchema
const ExpertOptionsSchema: ZodObject<{
additionalCapabilities: ZodOptional<ZodArray<ZodString>>;
enableHeuristics: ZodOptional<ZodBoolean>;
maxTokens: ZodOptional<ZodNumber>;
systemPromptOverride: ZodOptional<ZodString>;
temperature: ZodOptional<ZodNumber>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:252
Expert options schema.
ExpertOutputSchema
const ExpertOutputSchema: ZodObject<{
confidence: ZodNumber;
content: ZodString;
recommendations: ZodOptional<ZodArray<ZodString>>;
structuredData: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
warnings: ZodOptional<ZodArray<ZodString>>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:263
Expert output schema.
ExpertParticipationSchema
const ExpertParticipationSchema: ZodObject<{
expertId: ZodString;
joinedAt: ZodISODateTime;
retryCount: ZodNumber;
role: ZodEnum<{
architecture_expert: "architecture_expert";
code_expert: "code_expert";
custom: "custom";
documentation_expert: "documentation_expert";
orchestrator: "orchestrator";
security_expert: "security_expert";
testing_expert: "testing_expert";
}>;
status: ZodEnum<{
failed: "failed";
pending: "pending";
reviewing: "reviewing";
submitted: "submitted";
voted: "voted";
working: "working";
}>;
submittedAt: ZodOptional<ZodISODateTime>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-schemas.ts:72
Zod schema for ExpertParticipation.
ExplorationEventSchema
const ExplorationEventSchema: ZodObject<{
details: ZodRecord<ZodString, ZodUnknown>;
eventType: ZodEnum<{
conclusion_reached: "conclusion_reached";
cross_tree_share: "cross_tree_share";
forest_completed: "forest_completed";
forest_converging: "forest_converging";
node_activated: "node_activated";
node_completed: "node_completed";
node_created: "node_created";
node_deactivated: "node_deactivated";
node_pruned: "node_pruned";
path_scored: "path_scored";
tree_completed: "tree_completed";
tree_created: "tree_created";
}>;
nodeId: ZodOptional<ZodString>;
timestamp: ZodNumber;
treeId: ZodOptional<ZodString>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:140
Schema for ExplorationEvent validation.
ExplorationEventTypeSchema
const ExplorationEventTypeSchema: ZodEnum<{
conclusion_reached: "conclusion_reached";
cross_tree_share: "cross_tree_share";
forest_completed: "forest_completed";
forest_converging: "forest_converging";
node_activated: "node_activated";
node_completed: "node_completed";
node_created: "node_created";
node_deactivated: "node_deactivated";
node_pruned: "node_pruned";
path_scored: "path_scored";
tree_completed: "tree_completed";
tree_created: "tree_created";
}>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:106
Schema for ExplorationEventType validation.
FailurePatternSchema
const FailurePatternSchema: ZodObject<{
avgFailureScore: ZodNumber;
occurrences: ZodNumber;
pattern: ZodString;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:98
Schema for FailurePattern validation.
ForestConfigSchema
const ForestConfigSchema: ZodObject<{
activationBudget: ZodDefault<ZodNumber>;
activationStrategy: ZodDefault<ZodEnum<{
adaptive: "adaptive";
diverse: "diverse";
greedy: "greedy";
ucb: "ucb";
}>>;
confidenceThreshold: ZodDefault<ZodNumber>;
crossTreeStrategy: ZodDefault<ZodEnum<{
conclusions: "conclusions";
full: "full";
insights: "insights";
none: "none";
}>>;
earlyTerminationThreshold: ZodDefault<ZodNumber>;
enableCrossTreeSharing: ZodDefault<ZodBoolean>;
enableEarlyTermination: ZodDefault<ZodBoolean>;
enableParallelExploration: ZodDefault<ZodBoolean>;
explorationConstant: ZodDefault<ZodNumber>;
maxDepth: ZodDefault<ZodNumber>;
maxExplorationTimeMs: ZodDefault<ZodNumber>;
maxNodesPerTree: ZodDefault<ZodNumber>;
maxTokensPerTree: ZodDefault<ZodNumber>;
maxTrees: ZodDefault<ZodNumber>;
minScoreThreshold: ZodDefault<ZodNumber>;
nodeTimeoutMs: ZodDefault<ZodNumber>;
parallelThreads: ZodDefault<ZodNumber>;
pruningStrategy: ZodDefault<ZodEnum<{
combined: "combined";
depth: "depth";
none: "none";
score: "score";
}>>;
seed: ZodDefault<ZodNullable<ZodNumber>>;
sparsityRatio: ZodDefault<ZodNumber>;
temperature: ZodDefault<ZodNumber>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:122
Schema for ForestConfig validation.
ForestPruningStrategySchema
const ForestPruningStrategySchema: ZodEnum<{
combined: "combined";
depth: "depth";
none: "none";
score: "score";
}>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-config-types.ts:60
Schema for ForestPruningStrategy validation.
ForestResultSchema
const ForestResultSchema: ZodObject<{
bestSolution: ZodNullable<ZodObject<{
combinedScore: ZodNumber;
conclusionNode: ZodObject<{
activationScore: ZodNumber;
children: ZodArray<ZodString>;
confidence: ZodNumber;
content: ZodString;
createdAt: ZodNumber;
depth: ZodNumber;
estimatedValue: ZodNumber;
id: ZodString;
isActive: ZodBoolean;
metadata: ZodObject<{
crossReferences: ZodOptional<ZodArray<...>>;
custom: ZodOptional<ZodRecord<..., ...>>;
generationTimeMs: ZodOptional<ZodNumber>;
source: ZodOptional<ZodString>;
tokensUsed: ZodOptional<ZodNumber>;
}, $strip>;
parentId: ZodNullable<ZodString>;
qualityScore: ZodNumber;
state: ZodEnum<{
active: "active";
completed: "completed";
error: "error";
pending: "pending";
pruned: "pruned";
}>;
stepType: ZodEnum<{
conclusion: "conclusion";
decomposition: "decomposition";
hypothesis: "hypothesis";
inference: "inference";
synthesis: "synthesis";
verification: "verification";
}>;
treeId: ZodString;
updatedAt: ZodNumber;
}, $strip>;
confidence: ZodNumber;
path: ZodArray<ZodString>;
qualityScore: ZodNumber;
treeId: ZodString;
}, $strip>>;
durationMs: ZodNumber;
explorationHistory: ZodOptional<ZodArray<ZodObject<{
details: ZodRecord<ZodString, ZodUnknown>;
eventType: ZodEnum<{
conclusion_reached: "conclusion_reached";
cross_tree_share: "cross_tree_share";
forest_completed: "forest_completed";
forest_converging: "forest_converging";
node_activated: "node_activated";
node_completed: "node_completed";
node_created: "node_created";
node_deactivated: "node_deactivated";
node_pruned: "node_pruned";
path_scored: "path_scored";
tree_completed: "tree_completed";
tree_created: "tree_created";
}>;
nodeId: ZodOptional<ZodString>;
timestamp: ZodNumber;
treeId: ZodOptional<ZodString>;
}, $strip>>>;
finalState: ZodEnum<{
completed: "completed";
converging: "converging";
exploring: "exploring";
initializing: "initializing";
timeout: "timeout";
}>;
forestId: ZodString;
problem: ZodString;
statistics: ZodObject<{
activationRatio: ZodNumber;
activeTrees: ZodNumber;
avgTreeScore: ZodNumber;
bestPathScore: ZodNumber;
maxDepth: ZodNumber;
totalActiveNodes: ZodNumber;
totalExplorationTimeMs: ZodNumber;
totalNodes: ZodNumber;
totalTokensUsed: ZodNumber;
totalTrees: ZodNumber;
}, $strip>;
terminationReason: ZodEnum<{
convergence: "convergence";
error: "error";
max_depth: "max_depth";
max_time: "max_time";
max_tokens: "max_tokens";
no_progress: "no_progress";
solution_found: "solution_found";
}>;
topPaths: ZodArray<ZodObject<{
breakdown: ZodObject<{
coherenceScore: ZodNumber;
conclusionBonus: ZodNumber;
confidenceScore: ZodNumber;
depthFactor: ZodNumber;
qualityScore: ZodNumber;
}, $strip>;
length: ZodNumber;
path: ZodArray<ZodString>;
reachesConclusion: ZodBoolean;
score: ZodNumber;
targetNodeId: ZodString;
treeId: ZodString;
}, $strip>>;
totalTokensUsed: ZodNumber;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:187
Schema for ForestResult validation (partial).
ForestStateSchema
const ForestStateSchema: ZodEnum<{
completed: "completed";
converging: "converging";
exploring: "exploring";
initializing: "initializing";
timeout: "timeout";
}>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-state-types.ts:33
Schema for ForestState validation.
ForestStatisticsSchema
const ForestStatisticsSchema: ZodObject<{
activationRatio: ZodNumber;
activeTrees: ZodNumber;
avgTreeScore: ZodNumber;
bestPathScore: ZodNumber;
maxDepth: ZodNumber;
totalActiveNodes: ZodNumber;
totalExplorationTimeMs: ZodNumber;
totalNodes: ZodNumber;
totalTokensUsed: ZodNumber;
totalTrees: ZodNumber;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-state-types.ts:74
Schema for ForestStatistics validation.
GeneratedTestSchema
const GeneratedTestSchema: ZodObject<{
code: ZodString;
name: ZodString;
scenarios: ZodArray<ZodString>;
target: ZodString;
type: ZodEnum<{
e2e: "e2e";
integration: "integration";
unit: "unit";
}>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:308
Generated test schema.
MIN_EXPERTS_FOR_PATTERN
const MIN_EXPERTS_FOR_PATTERN: {
aegean: 3;
consensus: 3;
parallel: 2;
reflexion: 1;
review: 2;
self-debug: 1;
self-refine: 1;
sequential: 1;
};
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-schemas.ts:135
Minimum number of experts for each pattern.
Type Declaration
aegean
readonly aegean: 3 = 3;
consensus
readonly consensus: 3 = 3;
parallel
readonly parallel: 2 = 2;
reflexion
readonly reflexion: 1 = 1;
review
readonly review: 2 = 2;
self-debug
readonly self-debug: 1 = 1;
self-refine
readonly self-refine: 1 = 1;
sequential
readonly sequential: 1 = 1;
ModelPreferenceSchema
const ModelPreferenceSchema: ZodObject<{
maxTokens: ZodOptional<ZodNumber>;
modelId: ZodOptional<ZodString>;
provider: ZodOptional<ZodString>;
temperature: ZodOptional<ZodNumber>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:87
Zod schema for ModelPreference.
NodeStateSchema
const NodeStateSchema: ZodEnum<{
active: "active";
completed: "completed";
error: "error";
pending: "pending";
pruned: "pruned";
}>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:50
Schema for NodeState validation.
OrchestratorOptionsSchema
const OrchestratorOptionsSchema: ZodObject<{
decompositionThreshold: ZodOptional<ZodNumber>;
enableParallelHints: ZodOptional<ZodBoolean>;
expertWeights: ZodOptional<ZodRecord<ZodString, ZodNumber>>;
maxSubtasks: ZodOptional<ZodNumber>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:343
Zod schema for OrchestratorOptions.
PathScoreBreakdownSchema
const PathScoreBreakdownSchema: ZodObject<{
coherenceScore: ZodNumber;
conclusionBonus: ZodNumber;
confidenceScore: ZodNumber;
depthFactor: ZodNumber;
qualityScore: ZodNumber;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:56
Schema for PathScoreBreakdown validation.
PathScoreSchema
const PathScoreSchema: ZodObject<{
breakdown: ZodObject<{
coherenceScore: ZodNumber;
conclusionBonus: ZodNumber;
confidenceScore: ZodNumber;
depthFactor: ZodNumber;
qualityScore: ZodNumber;
}, $strip>;
length: ZodNumber;
path: ZodArray<ZodString>;
reachesConclusion: ZodBoolean;
score: ZodNumber;
targetNodeId: ZodString;
treeId: ZodString;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:87
Schema for PathScore validation.
PruningStrategy
const PruningStrategy: {
HIERARCHICAL: "hierarchical";
LOWEST_PRIORITY: "lowest_priority";
OLDEST_FIRST: "oldest_first";
PRIORITY_WEIGHTED_AGE: "priority_weighted_age";
SEMANTIC: "semantic";
SLIDING_WINDOW: "sliding_window";
SUMMARIZE: "summarize";
};
Defined in: packages/nexus-agents/src/agents/context-pruner.ts:41
Strategy for pruning context when budget is exceeded.
Type Declaration
HIERARCHICAL
readonly HIERARCHICAL: "hierarchical" = 'hierarchical';
LOWEST_PRIORITY
readonly LOWEST_PRIORITY: "lowest_priority" = 'lowest_priority';
OLDEST_FIRST
readonly OLDEST_FIRST: "oldest_first" = 'oldest_first';
PRIORITY_WEIGHTED_AGE
readonly PRIORITY_WEIGHTED_AGE: "priority_weighted_age" = 'priority_weighted_age';
SEMANTIC
readonly SEMANTIC: "semantic" = 'semantic';
SLIDING_WINDOW
readonly SLIDING_WINDOW: "sliding_window" = 'sliding_window';
SUMMARIZE
readonly SUMMARIZE: "summarize" = 'summarize';
ReasoningNodeMetadataSchema
const ReasoningNodeMetadataSchema: ZodObject<{
crossReferences: ZodOptional<ZodArray<ZodString>>;
custom: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
generationTimeMs: ZodOptional<ZodNumber>;
source: ZodOptional<ZodString>;
tokensUsed: ZodOptional<ZodNumber>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:105
Schema for ReasoningNodeMetadata validation.
ReasoningNodeSchema
const ReasoningNodeSchema: ZodObject<{
activationScore: ZodNumber;
children: ZodArray<ZodString>;
confidence: ZodNumber;
content: ZodString;
createdAt: ZodNumber;
depth: ZodNumber;
estimatedValue: ZodNumber;
id: ZodString;
isActive: ZodBoolean;
metadata: ZodObject<{
crossReferences: ZodOptional<ZodArray<ZodString>>;
custom: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
generationTimeMs: ZodOptional<ZodNumber>;
source: ZodOptional<ZodString>;
tokensUsed: ZodOptional<ZodNumber>;
}, $strip>;
parentId: ZodNullable<ZodString>;
qualityScore: ZodNumber;
state: ZodEnum<{
active: "active";
completed: "completed";
error: "error";
pending: "pending";
pruned: "pruned";
}>;
stepType: ZodEnum<{
conclusion: "conclusion";
decomposition: "decomposition";
hypothesis: "hypothesis";
inference: "inference";
synthesis: "synthesis";
verification: "verification";
}>;
treeId: ZodString;
updatedAt: ZodNumber;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:159
Schema for ReasoningNode validation.
ReasoningStepTypeSchema
const ReasoningStepTypeSchema: ZodEnum<{
conclusion: "conclusion";
decomposition: "decomposition";
hypothesis: "hypothesis";
inference: "inference";
synthesis: "synthesis";
verification: "verification";
}>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-node-types.ts:73
Schema for ReasoningStepType validation.
ReasoningTreeSchema
const ReasoningTreeSchema: ZodObject<{
createdAt: ZodNumber;
explorationPriority: ZodNumber;
forestId: ZodString;
hypothesis: ZodString;
id: ZodString;
overallScore: ZodNumber;
rootId: ZodString;
state: ZodEnum<{
abandoned: "abandoned";
completed: "completed";
growing: "growing";
paused: "paused";
}>;
statistics: ZodObject<{
activeNodes: ZodNumber;
avgBranchingFactor: ZodNumber;
avgConfidence: ZodNumber;
avgQualityScore: ZodNumber;
conclusionCount: ZodNumber;
maxDepth: ZodNumber;
totalNodes: ZodNumber;
totalTokensUsed: ZodNumber;
}, $strip>;
updatedAt: ZodNumber;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:205
Schema for ReasoningTree validation (partial, excludes Map for JSON).
ReviewResponseMessageSchema
const ReviewResponseMessageSchema: ZodObject<{
approved: ZodBoolean;
feedback: ZodString;
requesterId: ZodString;
reviewerId: ZodString;
severity: ZodOptional<ZodEnum<{
critical: "critical";
major: "major";
minor: "minor";
none: "none";
}>>;
suggestions: ZodOptional<ZodArray<ZodString>>;
type: ZodLiteral<"review_response">;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-schemas.ts:103
Zod schema for ReviewResponseMessage.
ScoreBreakdownSchema
const ScoreBreakdownSchema: ZodObject<{
capabilityScore: ZodNumber;
domainScore: ZodNumber;
finalScore: ZodNumber;
weightScore: ZodNumber;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:121
Agents exports - Agent framework, Orchestrator, Experts Split from index.ts for file size compliance (Issue #285)
SelectionOptionsSchema
const SelectionOptionsSchema: ZodObject<{
capabilityWeights: ZodOptional<ZodRecord<ZodString, ZodNumber>>;
excludeExperts: ZodOptional<ZodArray<ZodString>>;
forceCollaboration: ZodOptional<ZodBoolean>;
maxAlternatives: ZodOptional<ZodNumber>;
minScore: ZodOptional<ZodNumber>;
preferredDomains: ZodOptional<ZodArray<ZodEnum<{
architecture: "architecture";
code: "code";
documentation: "documentation";
general: "general";
security: "security";
testing: "testing";
}>>>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:144
Agents exports - Agent framework, Orchestrator, Experts Split from index.ts for file size compliance (Issue #285)
SelectionResultSchema
const SelectionResultSchema: ZodObject<{
alternatives: ZodArray<ZodObject<{
expertId: ZodString;
matchedCapabilities: ZodArray<ZodString>;
reasoning: ZodString;
score: ZodNumber;
scoreBreakdown: ZodObject<{
capabilityScore: ZodNumber;
domainScore: ZodNumber;
finalScore: ZodNumber;
weightScore: ZodNumber;
}, $strip>;
}, $strip>>;
confidence: ZodNumber;
primary: ZodObject<{
expertId: ZodString;
matchedCapabilities: ZodArray<ZodString>;
reasoning: ZodString;
score: ZodNumber;
scoreBreakdown: ZodObject<{
capabilityScore: ZodNumber;
domainScore: ZodNumber;
finalScore: ZodNumber;
weightScore: ZodNumber;
}, $strip>;
}, $strip>;
requiresCollaboration: ZodBoolean;
suggestedPattern: ZodOptional<ZodEnum<{
pair: "pair";
parallel: "parallel";
review_chain: "review_chain";
sequential: "sequential";
}>>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector-types.ts:136
Agents exports - Agent framework, Orchestrator, Experts Split from index.ts for file size compliance (Issue #285)
SessionStatusSchema
const SessionStatusSchema: ZodEnum<{
awaiting_review: "awaiting_review";
completed: "completed";
failed: "failed";
finalizing: "finalizing";
in_progress: "in_progress";
pending: "pending";
timed_out: "timed_out";
voting: "voting";
}>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-schemas.ts:26
Zod schema for SessionStatus.
SharedConclusionSchema
const SharedConclusionSchema: ZodObject<{
confidence: ZodNumber;
content: ZodString;
qualityScore: ZodNumber;
sourceNodeId: ZodString;
sourceTreeId: ZodString;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:51
Schema for SharedConclusion validation.
SharedInsightSchema
const SharedInsightSchema: ZodObject<{
content: ZodString;
relevance: ZodNumber;
sourceNodeId: ZodString;
sourceTreeId: ZodString;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-types.ts:76
Schema for SharedInsight validation.
SubtaskPrioritySchema
const SubtaskPrioritySchema: ZodEnum<{
critical: "critical";
high: "high";
low: "low";
medium: "medium";
}>;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:192
Zod schema for SubtaskPriority.
SubTaskSchema
const SubTaskSchema: ZodObject<{
assignedRole: ZodOptional<ZodEnum<{
architecture_expert: "architecture_expert";
code_expert: "code_expert";
custom: "custom";
devops_expert: "devops_expert";
documentation_expert: "documentation_expert";
infrastructure_expert: "infrastructure_expert";
orchestrator: "orchestrator";
pm_expert: "pm_expert";
research_expert: "research_expert";
security_expert: "security_expert";
testing_expert: "testing_expert";
ux_expert: "ux_expert";
}>>;
complexity: ZodNumber;
dependencies: ZodArray<ZodString>;
description: ZodString;
expectedOutput: ZodString;
id: ZodString;
parentTaskId: ZodString;
priority: ZodEnum<{
critical: "critical";
high: "high";
low: "low";
medium: "medium";
}>;
requiredCapabilities: ZodArray<ZodString>;
status: ZodEnum<{
assigned: "assigned";
completed: "completed";
failed: "failed";
in_progress: "in_progress";
pending: "pending";
}>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:208
Zod schema for SubTask.
SubtaskStatusSchema
const SubtaskStatusSchema: ZodEnum<{
assigned: "assigned";
completed: "completed";
failed: "failed";
in_progress: "in_progress";
pending: "pending";
}>;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:197
Zod schema for SubtaskStatus.
SynthesizedResultSchema
const SynthesizedResultSchema: ZodObject<{
collaborationMetadata: ZodOptional<ZodObject<{
agreementLevel: ZodNumber;
participantCount: ZodNumber;
pattern: ZodString;
sessionId: ZodString;
}, $strip>>;
combinedOutput: ZodString;
conflicts: ZodArray<ZodObject<{
description: ZodString;
resolution: ZodString;
subtaskId1: ZodString;
subtaskId2: ZodString;
}, $strip>>;
qualityScore: ZodNumber;
recommendations: ZodArray<ZodString>;
resultSummaries: ZodArray<ZodObject<{
contributions: ZodArray<ZodString>;
quality: ZodNumber;
subtaskId: ZodString;
summary: ZodString;
}, $strip>>;
summary: ZodString;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:330
Zod schema for SynthesizedResult.
TASK_TYPE_EXPERTS
const TASK_TYPE_EXPERTS: Readonly<Record<string, AgentRole>>;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:379
Task type to expert role mapping. Maps common task types to their primary expert roles.
TaskAnalysisSchema
const TaskAnalysisSchema: ZodObject<{
approach: ZodString;
commitment: ZodOptional<ZodObject<{
approach: ZodString;
constraints: ZodArray<ZodString>;
differentiation: ZodString;
purpose: ZodString;
}, $strip>>;
complexity: ZodPipe<ZodUnion<readonly [ZodNumber, ZodString]>, ZodTransform<number, string | number>>;
estimatedEffort: ZodPipe<ZodUnion<readonly [ZodNumber, ZodString]>, ZodTransform<number, string | number>>;
needsDecomposition: ZodPipe<ZodUnion<readonly [ZodBoolean, ZodString]>, ZodTransform<boolean, string | boolean>>;
requirements: ZodArray<ZodString>;
risks: ZodArray<ZodString>;
taskId: ZodString;
taskType: ZodString;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/tech-lead-types.ts:244
Zod schema for TaskAnalysis. Uses coercion and transforms for numeric fields because LLMs may return numbers as strings or descriptive words (Issue #663).
TaskSchema
const TaskSchema: ZodObject<{
constraints: ZodOptional<ZodObject<{
maxDuration: ZodOptional<ZodNumber>;
maxTokens: ZodOptional<ZodNumber>;
}, $strip>>;
context: ZodObject<{
files: ZodOptional<ZodArray<ZodString>>;
history: ZodOptional<ZodArray<ZodObject<{
content: ZodString;
role: ZodEnum<{
assistant: "assistant";
system: "system";
user: "user";
}>;
timestamp: ZodString;
}, $strip>>>;
metadata: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
workingDirectory: ZodOptional<ZodString>;
}, $strip>;
description: ZodString;
id: ZodString;
priority: ZodOptional<ZodNumber>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/agent-schemas.ts:13
Zod schema for validating Task objects.
TerminationReasonSchema
const TerminationReasonSchema: ZodEnum<{
convergence: "convergence";
error: "error";
max_depth: "max_depth";
max_time: "max_time";
max_tokens: "max_tokens";
no_progress: "no_progress";
solution_found: "solution_found";
}>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-result-types.ts:38
Schema for TerminationReason validation.
TreeStateSchema
const TreeStateSchema: ZodEnum<{
abandoned: "abandoned";
completed: "completed";
growing: "growing";
paused: "paused";
}>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:31
Schema for TreeState validation.
TreeStatisticsSchema
const TreeStatisticsSchema: ZodObject<{
activeNodes: ZodNumber;
avgBranchingFactor: ZodNumber;
avgConfidence: ZodNumber;
avgQualityScore: ZodNumber;
conclusionCount: ZodNumber;
maxDepth: ZodNumber;
totalNodes: ZodNumber;
totalTokensUsed: ZodNumber;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/reasoning/forest-tree-types.ts:153
Schema for TreeStatistics validation.
TRINITY_ROLE_MAX_TOKENS
const TRINITY_ROLE_MAX_TOKENS: Record<TrinityRole, number>;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:91
Default max tokens for TRINITY roles.
TRINITY_ROLE_PROMPTS
const TRINITY_ROLE_PROMPTS: Record<TrinityRole, string>;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:35
Default prompts for each TRINITY role.
TRINITY_ROLE_TEMPERATURES
const TRINITY_ROLE_TEMPERATURES: Record<TrinityRole, number>;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:84
Default temperatures for TRINITY roles.
TrinityConfigSchema
const TrinityConfigSchema: ZodObject<{
includeHistory: ZodOptional<ZodBoolean>;
maxIterations: ZodOptional<ZodNumber>;
roleConfigs: ZodOptional<ZodRecord<ZodEnum<{
thinker: "thinker";
verifier: "verifier";
worker: "worker";
}>, ZodObject<{
maxTokens: ZodOptional<ZodNumber>;
systemPrompt: ZodOptional<ZodString>;
temperature: ZodOptional<ZodNumber>;
}, $strip>>>;
timeoutMs: ZodOptional<ZodNumber>;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:229
Schema for TrinityConfig.
TrinityPhaseSchema
const TrinityPhaseSchema: ZodEnum<{
complete: "complete";
thinking: "thinking";
verifying: "verifying";
working: "working";
}>;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:223
Schema for TRINITY phase.
TrinityRoleSchema
const TrinityRoleSchema: ZodEnum<{
thinker: "thinker";
verifier: "verifier";
worker: "worker";
}>;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:220
Schema for TRINITY role.
TrinityStopReasonSchema
const TrinityStopReasonSchema: ZodEnum<{
error: "error";
max_iterations: "max_iterations";
timeout: "timeout";
verified: "verified";
}>;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:246
Schema for stop reason.
VerifierVerdictSchema
const VerifierVerdictSchema: ZodEnum<{
fail: "fail";
pass: "pass";
}>;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-types.ts:226
Schema for verifier verdict.
VoteDecisionSchema
const VoteDecisionSchema: ZodEnum<{
abstain: "abstain";
approve: "approve";
reject: "reject";
}>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-schemas.ts:40
Zod schema for VoteDecision.
VoteMessageSchema
const VoteMessageSchema: ZodObject<{
conditions: ZodOptional<ZodArray<ZodString>>;
decision: ZodEnum<{
abstain: "abstain";
approve: "approve";
reject: "reject";
}>;
expertId: ZodString;
reasoning: ZodString;
type: ZodLiteral<"vote">;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-schemas.ts:92
Zod schema for VoteMessage.
VulnerabilitySchema
const VulnerabilitySchema: ZodObject<{
cweId: ZodOptional<ZodString>;
description: ZodString;
id: ZodString;
location: ZodOptional<ZodString>;
remediation: ZodString;
severity: ZodEnum<{
critical: "critical";
high: "high";
info: "info";
low: "low";
medium: "medium";
}>;
type: ZodString;
}, $strip>;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:279
Vulnerability schema.
VulnerabilitySeveritySchema
const VulnerabilitySeveritySchema: ZodEnum<{
critical: "critical";
high: "high";
info: "info";
low: "low";
medium: "medium";
}>;
Defined in: packages/nexus-agents/src/agents/experts/expert-types.ts:274
Vulnerability severity schema.
Functions
aggregateResults()
function aggregateResults(input, options?): Result<AggregatedResult, AgentError>;
Defined in: packages/nexus-agents/src/agents/collaboration/result-aggregator.ts:241
Convenience function to aggregate results.
Parameters
input
options?
Returns
Result<AggregatedResult, AgentError>
chunkByDirectory()
function chunkByDirectory(files, basePath): WorkChunk[];
Defined in: packages/nexus-agents/src/agents/wave-scheduler.ts:376
Partition a list of file paths into directory-scoped chunks. Each chunk corresponds to a top-level directory within the base path.
Parameters
files
readonly string[]
Array of file paths
basePath
string
Base path prefix to strip for grouping
Returns
Array of work chunks grouped by top-level directory
classifyExpertFailure()
function classifyExpertFailure(
error,
detector,
taskDescription?,
signal?
): FailureClassification;
Defined in: packages/nexus-agents/src/agents/experts/expert-recovery.ts:198
Classifies a single failed execution attempt as transient or permanent.
See the module header for the ordered decision procedure. signal is checked
first (mandatory guard): RETRYABLE_ERROR_PATTERNS matches /aborted/i, so
without this a cancelled task would otherwise be retried.
Fails CLOSED on a throwing classifier (#4303): the body reads error.message
and walks .cause (via getErrorMessage/extractErrorMessage/isRetryableErrorChain)
and calls detector.detect. An Error-like object with a throwing .message or
.cause getter would make any of those throw. execute() runs this INSIDE
withRetry’s isRetryable predicate and again in annotateExhausted, neither of
which is try-guarded by withRetry (adapters/retry.ts:339-363 catches only
operation()), so an escaping throw would reject the Promise<Result<…>> and
break the never-throws contract execute_expert relies on. This single outer
guard covers BOTH call sites: any throw during classification → permanent.
Parameters
error
unknown
detector
FailureDetector
taskDescription?
string
signal?
AbortSignal
Returns
createAgenticAdapter()
function createAgenticAdapter(modelAdapter, options?): IAgenticAdapter;
Defined in: packages/nexus-agents/src/agents/agentic/factory.ts:25
Build an IAgenticAdapter for the supplied model adapter.
Stamps adapterStrategy based on the model’s providerId so
downstream eval results record which path they exercised. Future
provider-specialised concretes will set their own strategy.
Parameters
modelAdapter
options?
Returns
createArchitectureExpert()
function createArchitectureExpert(options?): ArchitectureExpert;
Defined in: packages/nexus-agents/src/agents/experts/architecture-expert.ts:244
Agents exports - Agent framework, Orchestrator, Experts Split from index.ts for file size compliance (Issue #285)
Parameters
options?
Partial<BaseAgentOptions> & {
expertOptions?: ArchitectureExpertOptions;
}
Returns
createCodeExpert()
function createCodeExpert(options?): CodeExpert;
Defined in: packages/nexus-agents/src/agents/experts/code-expert.ts:221
Creates a new CodeExpert agent with the given options.
Parameters
options?
Partial<BaseAgentOptions> & {
expertOptions?: CodeExpertOptions;
}
Returns
createCollaborationSession()
function createCollaborationSession(options?): CollaborationSession;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:449
Agents exports - Agent framework, Orchestrator, Experts Split from index.ts for file size compliance (Issue #285)
Parameters
options?
Returns
createDefaultRegistry()
function createDefaultRegistry(): SelectionExpertRegistry;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector.ts:114
Creates a default expert registry with built-in experts.
Returns
createDocumentationExpert()
function createDocumentationExpert(options?): DocumentationExpert;
Defined in: packages/nexus-agents/src/agents/experts/documentation-expert.ts:312
Agents exports - Agent framework, Orchestrator, Experts Split from index.ts for file size compliance (Issue #285)
Parameters
options?
Partial<BaseAgentOptions> & {
expertOptions?: DocumentationExpertOptions;
}
Returns
createOrchestrator()
function createOrchestrator(options?): Orchestrator;
Defined in: packages/nexus-agents/src/agents/tech-lead.ts:597
Creates a new Orchestrator agent with the given options. This is the preferred factory function for creating coordination agents.
Parameters
options?
Partial<BaseAgentOptions> & {
orchestratorOptions?: OrchestratorOptions;
}
Agent configuration options
Returns
Orchestrator agent instance
Example
const orchestrator = createOrchestrator({
orchestratorOptions: { maxSubtasks: 5 }
});
const result = await orchestrator.execute(task);
createProtocolFactory()
function createProtocolFactory(options?): ProtocolFactory;
Defined in: packages/nexus-agents/src/agents/collaboration/collaboration-protocol.ts:312
Creates a protocol factory.
Parameters
options?
Returns
createResultAggregator()
function createResultAggregator(options?): ResultAggregator;
Defined in: packages/nexus-agents/src/agents/collaboration/result-aggregator.ts:234
Creates a result aggregator.
Parameters
options?
Returns
createSecurityExpert()
function createSecurityExpert(options?): SecurityExpert;
Defined in: packages/nexus-agents/src/agents/experts/security-expert.ts:249
Agents exports - Agent framework, Orchestrator, Experts Split from index.ts for file size compliance (Issue #285)
Parameters
options?
Partial<BaseAgentOptions> & {
expertOptions?: SecurityExpertOptions;
}
Returns
createStateMachine()
function createStateMachine(options?): AgentStateMachine;
Defined in: packages/nexus-agents/src/agents/state-machine.ts:333
Creates a new agent state machine.
Parameters
options?
State machine options
Returns
A new AgentStateMachine instance
createTestingExpert()
function createTestingExpert(options?): TestingExpert;
Defined in: packages/nexus-agents/src/agents/experts/testing-expert.ts:347
Agents exports - Agent framework, Orchestrator, Experts Split from index.ts for file size compliance (Issue #285)
Parameters
options?
Partial<BaseAgentOptions> & {
expertOptions?: TestingExpertOptions;
}
Returns
createTrinityCoordinator()
function createTrinityCoordinator(config?): TrinityCoordinator;
Defined in: packages/nexus-agents/src/agents/collaboration/trinity-coordinator.ts:447
Creates a TRINITY coordinator instance.
Parameters
config?
Returns
createWaveScheduler()
function createWaveScheduler(config?, logger?): WaveScheduler;
Defined in: packages/nexus-agents/src/agents/wave-scheduler.ts:408
Create a new WaveScheduler instance with the given configuration.
Parameters
config?
Partial<WaveSchedulerConfig> = {}
logger?
Returns
getExpertRegistry()
function getExpertRegistry(): ExpertRegistry;
Defined in: packages/nexus-agents/src/agents/experts/expert-registry.ts:402
Get the global expert registry instance.
Returns
quickSelect()
function quickSelect(task, options?): Result<SelectionResult, SelectionError>;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector.ts:404
Quick selection using default registry. Convenience function for simple use cases. Uses a cached registry for performance optimization.
Parameters
task
options?
Returns
Result<SelectionResult, SelectionError>
safeValidateExpertConfig()
function safeValidateExpertConfig(config):
| {
data: ExpertConfig;
success: true;
}
| {
error: ZodError;
success: false;
};
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:618
Safely validates an expert configuration.
Parameters
config
unknown
Configuration to validate
Returns
| {
data: ExpertConfig;
success: true;
}
| {
error: ZodError;
success: false;
}
Safe parse result with success/error
selectExperts()
function selectExperts(
task,
registry,
options?
): Result<SelectionResult, SelectionError>;
Defined in: packages/nexus-agents/src/agents/experts/expert-selector.ts:370
Selects the best experts for a task.
Parameters
task
The task to select experts for
registry
Registry of available experts
options?
Optional selection configuration
Returns
Result<SelectionResult, SelectionError>
validateExpertConfig()
function validateExpertConfig(config): ExpertConfig;
Defined in: packages/nexus-agents/src/agents/experts/expert-config.ts:609
Validates an expert configuration.
Parameters
config
unknown
Configuration to validate
Returns
Parsed config or throws on validation error