Package-level declarations

Types

Link copied to clipboard
class AgentHarness(model: ModelBinding, capabilities: suspend () -> List<Capability> = { emptyList() }, localSubAgents: suspend () -> List<LocalSubAgent> = { emptyList() }, remoteSubAgents: suspend () -> List<SubAgent> = { emptyList() }, maxDepth: Int = 2)

An in-app agent: a model plus capabilities (tools, skills, MCP servers…), served as a ChatBackend for dev.ai.elements.core.chat.ChatController — the Kotlin counterpart of a Pydantic AI agent with Harness capabilities.

Link copied to clipboard
data class LocalSubAgent(val name: String, val description: String, val instructions: String, val model: ModelBinding? = null)

A sub-agent the harness runs itself: its own instructions (and optionally its own model) with the harness' capabilities.

Link copied to clipboard
fun interface ModelBinding

How to reach a model: builds the backend of one agent run from its tools and instructions. ProviderProfile.model adapts any configured provider.

Functions

Link copied to clipboard
fun ProviderProfile.model(apiKey: String = "", tokens: TokenSource? = null, systemPrompt: String? = null, agUiEventLog: AgUiEventLog? = null): ModelBinding

This provider as a ModelBinding (API key, or signed-in tokens); systemPrompt overrides the profile's; an AG-UI server's events go to agUiEventLog for replays.

Link copied to clipboard
suspend fun runHeadless(backend: ChatBackend, prompt: String, clock: () -> Long = System::currentTimeMillis): Message

Run one prompt on backend without a UI (scheduled or background work) and return the final answer. Throws when the run reports an error.

Link copied to clipboard
suspend fun AgentHarness.runHeadless(prompt: String, approver: ToolApprover = ToolApprover { false }): Message

runHeadless on this harness. Nobody can approve tools here, so calls that need approval are denied unless approver says otherwise.