---
title: Agents API
description: Generated public TypeScript reference for @relkit/agents.
search:
  exclude: true
sidebar:
  icon: braces
---

{/* Generated by apps/docs/scripts/generate.ts. Do not edit. */}

## Common APIs

- [approveApproval](/docs/api/agents#approveapproval)
- [denyApproval](/docs/api/agents#denyapproval)
- [defineAgent](/docs/api/agents#defineagent)

For configuration and examples, read [approvals](/docs/modules/ai/approvals), [agents](/docs/modules/ai/agents), [organization](/docs/modules/service/organization).

For a complete workflow, follow [build an offline agent](/guides/ai/build-an-offline-agent).

## Frontend usage

[Observe an agent and send controls](/docs/modules/ai/streaming#use-from-the-frontend) shows the client side of this capability.

## Public imports

- `@relkit/agents` — 182 exports
- `@relkit/agents/client-events` — 5 exports

## All exported APIs

Names link to their complete contracts. Re-exports share their original contract; legacy exports keep their separate identity. Examples link to the API's inline sample, a maintained repository usage, or the shared module walkthrough.

| API                                                                                             | Kind  | Import from                                      | Example                                                                                                                           |
| ----------------------------------------------------------------------------------------------- | ----- | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
| [AcceptControlRequest](/docs/api/app#acceptcontrolrequest-interface)                            | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AcceptRunReceipt](/docs/api/app#acceptrunreceipt-interface)                                    | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AcceptRunRequest](/docs/api/app#acceptrunrequest-interface)                                    | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AdmitContinuationRequest](/docs/api/app#admitcontinuationrequest-type-alias)                   | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AGENT_OBSERVABILITY_PROTOCOL](/docs/api/agents#agent_observability_protocol)                   | Value | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AGENT_OBSERVABILITY_VERSION](/docs/api/agents#agent_observability_version)                     | Value | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AgentApprovalHandler](/docs/api/agents#agentapprovalhandler-type-alias)                        | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AgentCapturePolicy](/docs/api/agents#agentcapturepolicy-interface)                             | Type  | `@relkit/agents`                                 | [API example](/docs/api/agents#agentcapturepolicy-interface)                                                                      |
| [AgentCapturePolicyError](/docs/api/agents#agentcapturepolicyerror-class)                       | Value | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AgentCaptureRecord](/docs/api/agents#agentcapturerecord-interface)                             | Type  | `@relkit/agents`                                 | [API example](/docs/api/agents#agentcapturerecord-interface)                                                                      |
| [AgentChatMapping](/docs/api/agents#agentchatmapping-interface)                                 | Type  | `@relkit/agents`                                 | [API example](/docs/api/agents#agentchatmapping-interface)                                                                        |
| [AgentClientEvent](/docs/api/app#agentclientevent-type-alias)                                   | Type  | `@relkit/agents`, `@relkit/agents/client-events` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/client/tests/compatibility/agent-observation.test.ts#L174)  |
| [agentClientEvents](/docs/api/agents#agentclientevents-1)                                       | Value | `@relkit/agents`, `@relkit/agents/client-events` | [API example](/docs/api/agents#agentclientevents-1)                                                                               |
| [AgentClientEvents](/docs/api/agents#agentclientevents-type-alias)                              | Type  | `@relkit/agents`                                 | [API example](/docs/api/agents#agentclientevents-type-alias)                                                                      |
| [agentClientEventsEffect](/docs/api/agents#agentclienteventseffect)                             | Value | `@relkit/agents`, `@relkit/agents/client-events` | [API example](/docs/api/agents#agentclienteventseffect)                                                                           |
| [AgentClientPolicy](/docs/api/agents#agentclientpolicy-type-alias)                              | Type  | `@relkit/agents`                                 | [API example](/docs/api/agents#agentclientpolicy-type-alias)                                                                      |
| [AgentClientPolicyError](/docs/api/agents#agentclientpolicyerror-class)                         | Value | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AgentContentSink](/docs/api/agents#agentcontentsink-interface)                                 | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AgentControl](/docs/api/agents#agentcontrol-type-alias)                                        | Type  | `@relkit/agents`                                 | [API example](/docs/api/agents#agentcontrol-type-alias)                                                                           |
| [AgentConversationMessage](/docs/api/agents#agentconversationmessage-interface)                 | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AgentDescriptor](/docs/api/agents#agentdescriptor-interface)                                   | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AgentEdgeRelationship](/docs/api/agents#agentedgerelationship-type-alias)                      | Type  | `@relkit/agents`                                 | [API example](/docs/api/agents#agentedgerelationship-type-alias)                                                                  |
| [AgentExecutionEvent](/docs/api/app#agentexecutionevent-interface)                              | Type  | `@relkit/agents`                                 | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/client/tests/compatibility/agent-observation.test.ts#L236)  |
| [AgentExecutionSnapshot](/docs/api/app#agentexecutionsnapshot-interface)                        | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AgentInstructions](/docs/api/agents#agentinstructions-type-alias)                              | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AgentLimits](/docs/api/agents#agentlimits-interface)                                           | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AgentObservabilitySink](/docs/api/agents#agentobservabilitysink-interface)                     | Type  | `@relkit/agents`                                 | [API example](/docs/api/agents#agentobservabilitysink-interface)                                                                  |
| [AgentObservation](/docs/api/app#agentobservation-type-alias)                                   | Type  | `@relkit/agents`                                 | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/client/tests/compatibility/agent-observer.test.ts#L97)      |
| [AgentObservedEdge](/docs/api/agents#agentobservededge-interface)                               | Type  | `@relkit/agents`                                 | [API example](/docs/api/agents#agentobservededge-interface)                                                                       |
| [AgentOperation](/docs/api/agents#agentoperation-type-alias)                                    | Type  | `@relkit/agents`                                 | [API example](/docs/api/agents#agentoperation-type-alias)                                                                         |
| [AgentProgressEvent](/docs/api/app#agentprogressevent-type-alias)                               | Type  | `@relkit/agents`, `@relkit/agents/client-events` | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AgentProgressScope](/docs/api/app#agentprogressscope-type-alias)                               | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AgentRequestScope](/docs/api/app#agentrequestscope-interface)                                  | Type  | `@relkit/agents`                                 | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/agent-state-failure/fixture.ts#L57)   |
| [AgentRuntimeHooks](/docs/api/agents#agentruntimehooks-interface)                               | Type  | `@relkit/agents`                                 | [API example](/docs/api/agents#agentruntimehooks-interface)                                                                       |
| [AgentSpanCapture](/docs/api/agents#agentspancapture-interface)                                 | Type  | `@relkit/agents`                                 | [API example](/docs/api/agents#agentspancapture-interface)                                                                        |
| [AgentStateLimits](/docs/api/app#agentstatelimits-interface)                                    | Type  | `@relkit/agents`                                 | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/agent-state-failure/fixture.ts#L21)   |
| [AgentStateProvider](/docs/api/app#agentstateprovider-interface)                                | Type  | `@relkit/agents`                                 | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/agent-state/fixture.ts#L57)           |
| [AgentSteeringSource](/docs/api/agents#agentsteeringsource-interface)                           | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AgentTelemetry](/docs/api/agents#agenttelemetry-class)                                         | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#agenttelemetry-class)                                                                              |
| [AgentTelemetryLive](/docs/api/agents#agenttelemetrylive)                                       | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#agenttelemetrylive)                                                                                |
| [AgentTelemetryService](/docs/api/agents#agenttelemetryservice-interface)                       | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AgentToolEvent](/docs/api/app#agenttoolevent-type-alias)                                       | Type  | `@relkit/agents`, `@relkit/agents/client-events` | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AgentToolReferences](/docs/api/agents#agenttoolreferences-type-alias)                          | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AgentTransitionError](/docs/api/app#agenttransitionerror-type-alias)                           | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AgentWaitingRequest](/docs/api/app#agentwaitingrequest-interface)                              | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AgentWaitingState](/docs/api/app#agentwaitingstate-interface)                                  | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [AppendJournalRequest](/docs/api/app#appendjournalrequest-interface)                            | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [APPROVAL_STATES](/docs/api/agents#approval_states)                                             | Value | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ApprovalDeniedError](/docs/api/agents#approvaldeniederror-class)                               | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#approvaldeniederror-class)                                                                         |
| [ApprovalEffectError](/docs/api/agents#approvaleffecterror-class)                               | Value | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ApprovalMetadata](/docs/api/agents#approvalmetadata-interface)                                 | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ApprovalOptions](/docs/api/agents#approvaloptions-interface)                                   | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ApprovalPolicy](/docs/api/agents#approvalpolicy-type-alias)                                    | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ApprovalRecord](/docs/api/agents#approvalrecord-type-alias)                                    | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ApprovalRequiredError](/docs/api/agents#approvalrequirederror-class)                           | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#approvalrequirederror-class)                                                                       |
| [ApprovalSideEffect](/docs/api/agents#approvalsideeffect-type-alias)                            | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ApprovalState](/docs/api/agents#approvalstate-type-alias)                                      | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ApprovalStateError](/docs/api/agents#approvalstateerror-class)                                 | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#approvalstateerror-class)                                                                          |
| [approveApproval](/docs/api/agents#approveapproval)                                             | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#approveapproval)                                                                                   |
| [approveApprovalEffect](/docs/api/agents#approveapprovaleffect)                                 | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#approveapprovaleffect)                                                                             |
| [ApprovedApproval](/docs/api/agents#approvedapproval-interface)                                 | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [assertAgentDescriptor](/docs/api/agents#assertagentdescriptor)                                 | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#assertagentdescriptor)                                                                             |
| [assertApprovalGranted](/docs/api/agents#assertapprovalgranted)                                 | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#assertapprovalgranted)                                                                             |
| [assertApprovalGrantedEffect](/docs/api/agents#assertapprovalgrantedeffect)                     | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#assertapprovalgrantedeffect)                                                                       |
| [BrowserMessage](/docs/api/app#browsermessage-interface)                                        | Type  | `@relkit/agents`                                 | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/client/tests/compatibility/agent-observation.test.ts#L23)   |
| [BrowserMessagePart](/docs/api/app#browsermessagepart-type-alias)                               | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [captureAgentContent](/docs/api/agents#captureagentcontent)                                     | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#captureagentcontent)                                                                               |
| [captureAgentContentEffect](/docs/api/agents#captureagentcontenteffect)                         | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#captureagentcontenteffect)                                                                         |
| [ClaimControlRequest](/docs/api/app#claimcontrolrequest-interface)                              | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ClaimRunRequest](/docs/api/app#claimrunrequest-interface)                                      | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [clientPolicyCount](/docs/api/agents#clientpolicycount)                                         | Value | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [clientPolicyFailures](/docs/api/agents#clientpolicyfailures)                                   | Value | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [CompleteRunRequest](/docs/api/app#completerunrequest-interface)                                | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [CompletionReceipt](/docs/api/app#completionreceipt-interface)                                  | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ContinuationIdentity](/docs/api/app#continuationidentity-interface)                            | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ContinuationReceipt](/docs/api/app#continuationreceipt-interface)                              | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ContinuationReceiptLookup](/docs/api/app#continuationreceiptlookup-type-alias)                 | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ControlClaim](/docs/api/app#controlclaim-interface)                                            | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ControlEffectOutcome](/docs/api/app#controleffectoutcome-type-alias)                           | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ControlLimits](/docs/api/app#controllimits-interface)                                          | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ControlPage](/docs/api/app#controlpage-interface)                                              | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ControlReceipt](/docs/api/app#controlreceipt-interface)                                        | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ControlReceiptLookup](/docs/api/app#controlreceiptlookup-type-alias)                           | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ControlRecord](/docs/api/app#controlrecord-interface)                                          | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ControlStatus](/docs/api/app#controlstatus-type-alias)                                         | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [copyAgentChat](/docs/api/agents#copyagentchat)                                                 | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#copyagentchat)                                                                                     |
| [copyAgentChatEffect](/docs/api/agents#copyagentchateffect)                                     | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#copyagentchateffect)                                                                               |
| [copyAgentClientPolicy](/docs/api/agents#copyagentclientpolicy)                                 | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#copyagentclientpolicy)                                                                             |
| [copyAgentClientPolicyEffect](/docs/api/agents#copyagentclientpolicyeffect)                     | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#copyagentclientpolicyeffect)                                                                       |
| [copyAgentControls](/docs/api/agents#copyagentcontrols)                                         | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#copyagentcontrols)                                                                                 |
| [copyAgentControlsEffect](/docs/api/agents#copyagentcontrolseffect)                             | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#copyagentcontrolseffect)                                                                           |
| [copyAgentLimits](/docs/api/agents#copyagentlimits)                                             | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#copyagentlimits)                                                                                   |
| [copyAgentLimitsEffect](/docs/api/agents#copyagentlimitseffect)                                 | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#copyagentlimitseffect)                                                                             |
| [createAgentCapturePolicy](/docs/api/agents#createagentcapturepolicy)                           | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#createagentcapturepolicy)                                                                          |
| [createAgentCapturePolicyEffect](/docs/api/agents#createagentcapturepolicyeffect)               | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#createagentcapturepolicyeffect)                                                                    |
| [createAgentSpanCapture](/docs/api/agents#createagentspancapture)                               | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#createagentspancapture)                                                                            |
| [createAgentSpanCaptureEffect](/docs/api/agents#createagentspancaptureeffect)                   | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#createagentspancaptureeffect)                                                                      |
| [createApproval](/docs/api/agents#createapproval)                                               | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#createapproval)                                                                                    |
| [createApprovalEffect](/docs/api/agents#createapprovaleffect)                                   | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#createapprovaleffect)                                                                              |
| [createGeneratedAgentFunction](/docs/api/agents#creategeneratedagentfunction)                   | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#creategeneratedagentfunction)                                                                      |
| [createGeneratedAgentFunctionEffect](/docs/api/agents#creategeneratedagentfunctioneffect)       | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#creategeneratedagentfunctioneffect)                                                                |
| [CreateThreadReceipt](/docs/api/app#createthreadreceipt-interface)                              | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [CreateThreadRequest](/docs/api/app#createthreadrequest-interface)                              | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [decideThreadTransition](/docs/api/agents#decidethreadtransition)                               | Value | `@relkit/agents`                                 | [Source example](https://github.com/rel-kit/relkit/blob/main/integrations/packages/langchain/tests/thread-transition.test.ts#L20) |
| [decideThreadTransitionEffect](/docs/api/agents#decidethreadtransitioneffect)                   | Value | `@relkit/agents`                                 | [Source example](https://github.com/rel-kit/relkit/blob/main/integrations/packages/langchain/tests/thread-transition.test.ts#L45) |
| [defineAgent](/docs/api/agents#defineagent)                                                     | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#defineagent)                                                                                       |
| [defineAgentEffect](/docs/api/agents#defineagenteffect)                                         | Value | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [DefineAgentOptions](/docs/api/agents#defineagentoptions-interface)                             | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [DeniedApproval](/docs/api/agents#deniedapproval-interface)                                     | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [denyApproval](/docs/api/agents#denyapproval)                                                   | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#denyapproval)                                                                                      |
| [denyApprovalEffect](/docs/api/agents#denyapprovaleffect)                                       | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#denyapprovaleffect)                                                                                |
| [emitAgentEdge](/docs/api/agents#emitagentedge)                                                 | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#emitagentedge)                                                                                     |
| [emitAgentEdgeEffect](/docs/api/agents#emitagentedgeeffect)                                     | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#emitagentedgeeffect)                                                                               |
| [ExecutionClaim](/docs/api/app#executionclaim-interface)                                        | Type  | `@relkit/agents`                                 | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/agent-state/fixture.ts#L61)           |
| [GENERATED_AGENT_FUNCTION_PREFIX](/docs/api/agents#generated_agent_function_prefix)             | Value | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [GENERATED_AGENT_FUNCTION_SUFFIX](/docs/api/agents#generated_agent_function_suffix)             | Value | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [GeneratedAgentExecutor](/docs/api/agents#generatedagentexecutor-type-alias)                    | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [GeneratedAgentFunction](/docs/api/agents#generatedagentfunction-type-alias)                    | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [generatedAgentFunctionId](/docs/api/agents#generatedagentfunctionid)                           | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#generatedagentfunctionid)                                                                          |
| [generatedAgentFunctionIdEffect](/docs/api/agents#generatedagentfunctionideffect)               | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#generatedagentfunctionideffect)                                                                    |
| [GeneratedAgentFunctionMarker](/docs/api/agents#generatedagentfunctionmarker-interface)         | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [GeneratedAgentFunctionUnboundError](/docs/api/agents#generatedagentfunctionunbounderror-class) | Value | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [InterruptionReceipt](/docs/api/app#interruptionreceipt-interface)                              | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [InterruptOwnedRunRequest](/docs/api/app#interruptownedrunrequest-interface)                    | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [isAgentDescriptor](/docs/api/agents#isagentdescriptor)                                         | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#isagentdescriptor)                                                                                 |
| [isApprovalRecord](/docs/api/agents#isapprovalrecord)                                           | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#isapprovalrecord)                                                                                  |
| [isApprovalRecordEffect](/docs/api/agents#isapprovalrecordeffect)                               | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#isapprovalrecordeffect)                                                                            |
| [isGeneratedAgentFunction](/docs/api/agents#isgeneratedagentfunction)                           | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#isgeneratedagentfunction)                                                                          |
| [isGeneratedAgentFunctionEffect](/docs/api/agents#isgeneratedagentfunctioneffect)               | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#isgeneratedagentfunctioneffect)                                                                    |
| [JournalCheckpoint](/docs/api/app#journalcheckpoint-interface)                                  | Type  | `@relkit/agents`                                 | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/client/tests/compatibility/agent-observation.test.ts#L13)   |
| [JournalPage](/docs/api/app#journalpage-interface)                                              | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [JournalReceipt](/docs/api/app#journalreceipt-interface)                                        | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [JournalRecord](/docs/api/app#journalrecord-interface)                                          | Type  | `@relkit/agents`                                 | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/agents/tests/client-events.test.ts#L100)                    |
| [ListThreadsRequest](/docs/api/app#listthreadsrequest-interface)                                | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [LoadThreadRequest](/docs/api/app#loadthreadrequest-interface)                                  | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [LookupContinuationReceiptRequest](/docs/api/app#lookupcontinuationreceiptrequest-interface)    | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [LookupControlReceiptRequest](/docs/api/app#lookupcontrolreceiptrequest-interface)              | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [LookupRunReceiptRequest](/docs/api/app#lookuprunreceiptrequest-interface)                      | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [MarkControlEffectStartedRequest](/docs/api/app#markcontroleffectstartedrequest-interface)      | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ModelProviderConfiguration](/docs/api/agents#modelproviderconfiguration-interface)             | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ModelSelectionEffectError](/docs/api/agents#modelselectioneffecterror-class)                   | Value | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ModelSelectionError](/docs/api/agents#modelselectionerror-class)                               | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#modelselectionerror-class)                                                                         |
| [ModelSelectionErrorCode](/docs/api/agents#modelselectionerrorcode-type-alias)                  | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [normalizeModelSelector](/docs/api/agents#normalizemodelselector)                               | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#normalizemodelselector)                                                                            |
| [normalizeModelSelectorEffect](/docs/api/agents#normalizemodelselectoreffect)                   | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#normalizemodelselectoreffect)                                                                      |
| [observeAgent](/docs/api/agents#observeagent)                                                   | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#observeagent)                                                                                      |
| [parseModelProviderConfiguration](/docs/api/agents#parsemodelproviderconfiguration)             | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#parsemodelproviderconfiguration)                                                                   |
| [parseModelProviderConfigurationEffect](/docs/api/agents#parsemodelproviderconfigurationeffect) | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#parsemodelproviderconfigurationeffect)                                                             |
| [PendingApproval](/docs/api/agents#pendingapproval-interface)                                   | Type  | `@relkit/agents`                                 | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/runtime-hono/tests/agent-approval.fixture.ts#L40)           |
| [PromptInstructions](/docs/api/agents#promptinstructions-interface)                             | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [PromptTemplate](/docs/api/agents#prompttemplate-interface)                                     | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ReadControlsRequest](/docs/api/app#readcontrolsrequest-interface)                              | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ReadJournalRequest](/docs/api/app#readjournalrequest-interface)                                | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ReadSnapshotHistoryRequest](/docs/api/app#readsnapshothistoryrequest-interface)                | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [RecoverAbandonedControlRequest](/docs/api/app#recoverabandonedcontrolrequest-interface)        | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [RenewControlClaimRequest](/docs/api/app#renewcontrolclaimrequest-interface)                    | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [RenewRunClaimRequest](/docs/api/app#renewrunclaimrequest-interface)                            | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [requiresApproval](/docs/api/agents#requiresapproval)                                           | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#requiresapproval)                                                                                  |
| [requiresApprovalEffect](/docs/api/agents#requiresapprovaleffect)                               | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#requiresapprovaleffect)                                                                            |
| [ResolvedModelSelection](/docs/api/agents#resolvedmodelselection-interface)                     | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [resolveModelSelector](/docs/api/agents#resolvemodelselector)                                   | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#resolvemodelselector)                                                                              |
| [resolveModelSelectorEffect](/docs/api/agents#resolvemodelselectoreffect)                       | Value | `@relkit/agents`                                 | [API example](/docs/api/agents#resolvemodelselectoreffect)                                                                        |
| [RunOwner](/docs/api/app#runowner-interface)                                                    | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [RunReceiptLookup](/docs/api/app#runreceiptlookup-type-alias)                                   | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [RunStatus](/docs/api/app#runstatus-type-alias)                                                 | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [SettleControlRequest](/docs/api/app#settlecontrolrequest-interface)                            | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [SnapshotHistoryPage](/docs/api/app#snapshothistorypage-interface)                              | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [StoredApproval](/docs/api/app#storedapproval-interface)                                        | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [StoredRun](/docs/api/app#storedrun-interface)                                                  | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [StoredRunRouting](/docs/api/app#storedrunrouting-interface)                                    | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [StoredThread](/docs/api/app#storedthread-interface)                                            | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [SuspendRunRequest](/docs/api/app#suspendrunrequest-interface)                                  | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [SuspensionReceipt](/docs/api/app#suspensionreceipt-interface)                                  | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ThreadAction](/docs/api/app#threadaction-type-alias)                                           | Type  | `@relkit/agents`                                 | [Source example](https://github.com/rel-kit/relkit/blob/main/integrations/packages/langchain/tests/thread-transition.test.ts#L15) |
| [ThreadList](/docs/api/app#threadlist-interface)                                                | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ThreadListItem](/docs/api/app#threadlistitem-interface)                                        | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ThreadSnapshot](/docs/api/app#threadsnapshot-interface)                                        | Type  | `@relkit/agents`                                 | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/client/tests/compatibility/agent-continuation.test.ts#L127) |
| [ThreadStatus](/docs/api/app#threadstatus-type-alias)                                           | Type  | `@relkit/agents`                                 | [Source example](https://github.com/rel-kit/relkit/blob/main/integrations/packages/langchain/tests/thread-transition.test.ts#L8)  |
| [ThreadTransition](/docs/api/app#threadtransition-type-alias)                                   | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [ToolPartState](/docs/api/app#toolpartstate-type-alias)                                         | Type  | `@relkit/agents`                                 | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/agents/tests/client-events.test.ts#L12)                     |
| [WaitForControlsRequest](/docs/api/app#waitforcontrolsrequest-interface)                        | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |
| [WaitForJournalRequest](/docs/api/app#waitforjournalrequest-interface)                          | Type  | `@relkit/agents`                                 | [Module example](/docs/modules/ai/approvals)                                                                                      |

## `agent-client-chat.ts`

### copyAgentChat

Copies a chat mapping for synchronous descriptor callers.

**Throws**

TypeError for a noncanonical mapping.

**Example**

```ts
import { copyAgentChat } from "@relkit/agents";

const chat = copyAgentChat({ input: "message", output: "answer" });
void chat;
```

**Signature**

```ts
declare const copyAgentChat: (value: unknown) => AgentChatMapping | undefined;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client-chat.ts#L64)

### copyAgentChatEffect

Validates the fixed chat input and output mapping.

**Example**

```ts
import { Effect } from "effect";
import { copyAgentChatEffect } from "@relkit/agents";

const chat = Effect.runSync(copyAgentChatEffect({ input: "message", output: "answer" }));
void chat;
```

**Signature**

```ts
declare const copyAgentChatEffect: (
  value: unknown,
) => Effect.Effect<
  Readonly<{ input: "message"; output: "answer" }> | undefined,
  AgentClientPolicyError,
  never
>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client-chat.ts#L24)

## `agent-client-controls.ts`

### copyAgentControls

Copies client controls for synchronous descriptor callers.

**Throws**

TypeError when an unsupported or duplicate control is present.

**Example**

```ts
import { copyAgentControls } from "@relkit/agents";

const controls = copyAgentControls(["stop"]);
void controls;
```

**Signature**

```ts
declare const copyAgentControls: (value: unknown) => readonly AgentControl[] | undefined;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client-controls.ts#L76)

### copyAgentControlsEffect

Validates and freezes client control capabilities.

**Example**

```ts
import { Effect } from "effect";
import { copyAgentControlsEffect } from "@relkit/agents";

const controls = Effect.runSync(copyAgentControlsEffect(["stop"]));
void controls;
```

**Signature**

```ts
declare const copyAgentControlsEffect: (
  value: unknown,
) => Effect.Effect<ReadonlyArray<AgentControl> | undefined, AgentClientPolicyError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client-controls.ts#L26)

## `agent-client-error.ts`

### AgentClientPolicyError (class)

Expected client configuration failure in the Effect error channel.

**Signature**

```ts
declare class AgentClientPolicyError
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client-error.ts#L4)

### clientPolicyCount

**Signature**

```ts
declare const clientPolicyCount: Metric.Counter<number>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client-error.ts#L9)

### clientPolicyFailures

**Signature**

```ts
declare const clientPolicyFailures: Metric.Counter<number>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client-error.ts#L10)

## `agent-client-policy.ts`

### copyAgentClientPolicy

Copies a client policy for synchronous descriptor callers.

**Throws**

TypeError for malformed access, state, or event declarations.

**Example**

```ts
import { copyAgentClientPolicy } from "@relkit/agents";

const policy = copyAgentClientPolicy({ public: true }, new Set<string>());
void policy;
```

**Signature**

```ts
declare const copyAgentClientPolicy: <StateKey extends string>(
  value: unknown,
  allowedStateKeys?: ReadonlySet<StateKey>,
) => AgentClientPolicy<(...args: any[]) => unknown, StateKey> | undefined;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client-policy.ts#L71)

### copyAgentClientPolicyEffect

Validates and freezes client access, state keys, and event schemas.

**Example**

```ts
import { Effect } from "effect";
import { copyAgentClientPolicyEffect } from "@relkit/agents";

const policy = Effect.runSync(copyAgentClientPolicyEffect({ public: true }, new Set<string>()));
void policy;
```

**Signature**

```ts
declare const copyAgentClientPolicyEffect: <StateKey extends string>(
  value: unknown,
  allowedStateKeys?: ReadonlySet<StateKey> | undefined,
) => Effect.Effect<
  | Readonly<{
      events?: Readonly<Record<string, StandardSchemaV1<unknown, unknown>>>;
      state?: ReadonlyArray<StateKey>;
      public: true;
    }>
  | Readonly<{
      events?: Readonly<Record<string, StandardSchemaV1<unknown, unknown>>>;
      state?: ReadonlyArray<StateKey>;
      authorize: (...args: any[]) => unknown;
    }>
  | undefined,
  AgentClientPolicyError,
  never
>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client-policy.ts#L26)

## `agent-client.ts`

### "./agent-client-chat.js" (namespace export)

Re-exports all named exports from the "./agent-client-chat.js" module.

**Signature**

```ts
export * from "./agent-client-chat.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client.ts#L3)

### "./agent-client-controls.js" (namespace export)

Re-exports all named exports from the "./agent-client-controls.js" module.

**Signature**

```ts
export * from "./agent-client-controls.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client.ts#L2)

### "./agent-client-error.js" (namespace export)

Re-exports all named exports from the "./agent-client-error.js" module.

**Signature**

```ts
export * from "./agent-client-error.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client.ts#L4)

### "./agent-client-policy.js" (namespace export)

Re-exports all named exports from the "./agent-client-policy.js" module.

**Signature**

```ts
export * from "./agent-client-policy.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client.ts#L1)

### AgentChatMapping

**Signature**

```ts
declare const AgentChatMapping: AgentChatMapping;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client.ts#L9)

### AgentClientEvents

**Signature**

```ts
declare const AgentClientEvents: Readonly<Record<string, StandardSchemaV1<unknown, unknown>>>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client.ts#L7)

### AgentClientPolicy

**Signature**

```ts
declare const AgentClientPolicy: AgentClientPolicy<Guard, StateKey, Events>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client.ts#L8)

### AgentControl

**Signature**

```ts
declare const AgentControl: AgentControl;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client.ts#L6)

## `agent-client.types.ts`

### AgentChatMapping (interface)

Fixed input and output field mapping for an agent chat client.

**Example**

```ts
const chat: AgentChatMapping = { input: "message", output: "answer" };
```

**Signature**

```ts
export interface AgentChatMapping {
  readonly input: "message";
  readonly output: "answer";
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client.types.ts#L43)

### AgentClientEvents (type alias)

Named public events and their Standard Schema validators.
Names must be nonempty before the policy is published.

**Example**

```ts
import { z } from "@relkit/schema";
const events: AgentClientEvents = { completed: z.string() };
```

**Signature**

```ts
type AgentClientEvents = Readonly<Record<string, StandardSchemaV1>>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client.types.ts#L19)

### AgentClientPolicy (type alias)

Client visibility, selected state, and public event schemas.
Exactly one of public access and an authorization guard must be supplied.

**Example**

```ts
const policy: AgentClientPolicy = { public: true, state: ["answer"] };
```

**Signature**

```ts
type AgentClientPolicy<
  Guard = (...args: any[]) => unknown,
  StateKey extends string = string,
  Events extends AgentClientEvents = AgentClientEvents,
> = (
  | { readonly public: true; readonly authorize?: never }
  | { readonly authorize: Guard; readonly public?: never }
) & {
  readonly state?: readonly StateKey[];
  readonly events?: Events;
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client.types.ts#L28)

### AgentControl (type alias)

Durable control capabilities that may be exposed to an agent client.

**Example**

```ts
const control: AgentControl = "stop";
```

**Signature**

```ts
type AgentControl = "steer" | "follow-up" | "stop" | "approve";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-client.types.ts#L9)

## `agent-telemetry.ts`

### AgentOperation

**Signature**

```ts
declare const AgentOperation: AgentOperation;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-telemetry.ts#L4)

### AgentTelemetry (class)

Injectable telemetry boundary for agent operations.

**Example**

```ts
Effect.provide(observeAgent("capture.policy", Effect.void), AgentTelemetryLive);
```

**Signature**

```ts
declare class AgentTelemetry
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-telemetry.ts#L9)

### AgentTelemetryLive

Live metric observer for traced agent operations.

**Example**

```ts
Effect.runSync(Effect.provide(observeAgent("capture.policy", Effect.void), AgentTelemetryLive));
```

**Signature**

```ts
declare const AgentTelemetryLive: Layer.Layer<AgentTelemetry, never, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-telemetry.ts#L16)

### AgentTelemetryService

**Signature**

```ts
declare const AgentTelemetryService: AgentTelemetryService;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-telemetry.ts#L4)

### observeAgent

Records a call, duration, and failure with a fixed operation label.

**Example**

```ts
observeAgent("capture.policy", Effect.succeed({ mode: "off" }));
```

**Signature**

```ts
declare const observeAgent: <A, E, R>(
  operation: AgentOperation,
  effect: Effect.Effect<A, E, R>,
) => Effect.Effect<A, E, R>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-telemetry.ts#L30)

## `agent-telemetry.types.ts`

### AgentOperation (type alias)

Fixed operation labels for agent telemetry; no user value is a label.

**Example**

```ts
const operation: AgentOperation = "runtime.invoke-tool";
```

**Signature**

```ts
type AgentOperation =
  | "client.controls"
  | "client.chat"
  | "client.copy"
  | "validation.schema"
  | "validation.is-schema"
  | "validation.positive-integer"
  | "validation.is-positive-integer"
  | "validation.is-record"
  | "capture.policy"
  | "capture.content"
  | "capture.span"
  | "client-schema.merge"
  | "client-schema.select"
  | "client-schema.project"
  | "client-events.project"
  | "graph-state.select"
  | "graph-interruption.response"
  | "graph-interruption.requests"
  | "graph-interruption.is-error"
  | "thread-transition.decide"
  | "runtime.invoke"
  | "runtime.create"
  | "approval.requires"
  | "approval.create"
  | "approval.approve"
  | "approval.deny"
  | "approval.assert-granted"
  | "approval.is-record"
  | "model-selector.normalize"
  | "model-selector.parse"
  | "model-selector.resolve"
  | "persistence.release"
  | "persistence.resolve-graph"
  | "persistence.resolve-agent"
  | "bucket.list"
  | "bucket.delete"
  | "bucket.glob"
  | "bucket.grep"
  | "bucket.read-data"
  | "bucket.write-data"
  | "bucket.scoped-keys"
  | "bucket.info"
  | "bucket.read-raw"
  | "bucket.read"
  | "bucket.write"
  | "bucket.edit"
  | "bucket.upload"
  | "bucket.download"
  | "bucket.create"
  | "bucket.thread"
  | "definition.copy-instructions"
  | "definition.is-instructions"
  | "definition.is-descriptor"
  | "definition.assert-descriptor"
  | "definition.normalize-model"
  | "definition.copy-deep"
  | "definition.has-deep"
  | "definition.is-model"
  | "definition.copy-middleware"
  | "definition.state-keys"
  | "definition.copy-tools"
  | "definition.tool-refs"
  | "graph.validate-resume"
  | "graph.waiting"
  | "graph.config"
  | "graph.resume-command"
  | "graph-node.destinations"
  | "graph-node.copy-ends"
  | "graph-node.result"
  | "graph-node.input"
  | "graph-node.handle"
  | "graph-node.define"
  | "graph-node.is-descriptor"
  | "definition.copy-limits"
  | "definition.define"
  | "generated.id"
  | "generated.create"
  | "generated.is-function"
  | "persistence.is-resource"
  | "persistence.assert-protocol"
  | "persistence.define-checkpointer"
  | "persistence.define-memory"
  | "runtime.resolve-model"
  | "runtime.content-limits"
  | "graph.invoke"
  | "graph.workflow"
  | "graph.requires-persistence"
  | "graph.define"
  | "graph.execution"
  | "graph.is-descriptor"
  | "graph.subgraph-create"
  | "graph.subgraph-is-node"
  | "graph.subgraph-source"
  | "native-hitl.response-schema"
  | "native-hitl.is-request"
  | "native-hitl.public-request"
  | "native-hitl.is-decision"
  | "native-hitl.is-record"
  | "native-hitl.resume-command"
  | "native-hitl.waiting"
  | "native-hitl.validate-reply"
  | "graph.compile"
  | "graph.route"
  | "graph.edge-builder"
  | "graph.add-edge"
  | "graph.add-conditional-edge"
  | "graph.destination"
  | "graph.validate-route"
  | "graph.prepare-definition"
  | "runtime.validate-value"
  | "runtime.json-value"
  | "runtime.model-failure"
  | "runtime.selected-state-schemas"
  | "graph-node.validate-destinations"
  | "graph-node.command-update"
  | "graph-node.validated-update"
  | "graph-node.validated-value"
  | "bucket.context"
  | "bucket.virtual-path"
  | "bucket.key"
  | "bucket.file-path"
  | "bucket.page"
  | "bucket.control-failure"
  | "bucket.error-message"
  | "bucket.text-mime-type"
  | "runtime.collect-native-events"
  | "runtime.emit-native-tool-event"
  | "runtime.selected-state"
  | "runtime.select-state-fields"
  | "runtime.native-public-event"
  | "runtime.public-event-value"
  | "runtime.public-tool-value"
  | "runtime.message-update"
  | "runtime.native-limits"
  | "runtime.model-limit"
  | "runtime.tool-limit"
  | "runtime.combine-native-tools"
  | "runtime.native-instructions"
  | "runtime.load-deepagents"
  | "runtime.assert-dependencies"
  | "runtime.model-tool-name"
  | "runtime.find-model-tool"
  | "runtime.find-tool"
  | "runtime.run-tool"
  | "runtime.emit-tool"
  | "runtime.resolve-approval"
  | "runtime.create-tool-dispatcher"
  | "runtime.invoke-tool"
  | "graph.stream-compiled"
  | "graph.run-compiled"
  | "observability.emit-edge"
  | "runtime.create-native-tools"
  | "runtime.create-agent-tools"
  | "runtime.response-format"
  | "runtime.child-model"
  | "runtime.create-subagents"
  | "runtime.create-native-agent"
  | "runtime.native-messages"
  | "runtime.response-value"
  | "runtime.unwrap-native-cause"
  | "runtime.run-loop"
  | "signal.failure"
  | "signal.create"
  | "signal.acquire"
  | "signal.with-signal"
  | "client.agent-metadata"
  | "client.graph-metadata";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-telemetry.types.ts#L6)

### AgentTelemetryService (interface)

Replaceable observer used by Effect operations and deterministic tests.

**Signature**

```ts
export interface AgentTelemetryService {
  /** Records an operation without changing its Effect channels.
   * @param operation - Fixed agent operation name.
   * @param effect - Work to instrument.
   * @returns The same success, error, and dependency channels.
   * @example telemetry.observe("capture.policy", Effect.succeed({ mode: "off" }));
   */
  readonly observe: <A, E, R>(
    operation: AgentOperation,
    effect: Effect.Effect<A, E, R>,
  ) => Effect.Effect<A, E, R>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-telemetry.types.ts#L176)

## `agent-validation-error.ts`

### AgentValidationError (class)

Typed validation failure raised by an Effect agent-authoring operation.

**Example**

```ts
const error = new AgentValidationError({
  operation: "positiveInteger",
  message: "limit must be positive",
});
```

**Signature**

```ts
declare class AgentValidationError
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-validation-error.ts#L9)

### validationCount

**Signature**

```ts
declare const validationCount: Metric.Counter<number>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-validation-error.ts#L14)

### validationFailures

**Signature**

```ts
declare const validationFailures: Metric.Counter<number>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-validation-error.ts#L15)

## `agent-validation-schema.ts`

### assertAgentSchema

Throws for an invalid schema in existing synchronous authoring calls.

**Throws**

TypeError when the value is not a Standard Schema v1 validator.

**Example**

```ts
assertAgentSchema(z.string(), "input");
```

**Signature**

```ts
declare const assertAgentSchema: (
  value: unknown,
  name: string,
) => asserts value is StandardSchemaV1;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-validation-schema.ts#L46)

### assertAgentSchemaEffect

Validates that a value implements the Standard Schema v1 protocol.

**Example**

```ts
const schema = Effect.runSync(assertAgentSchemaEffect(z.string(), "input"));
```

**Signature**

```ts
declare const assertAgentSchemaEffect: (
  value: unknown,
  name: string,
) => Effect.Effect<StandardSchemaV1<unknown, unknown>, AgentValidationError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-validation-schema.ts#L19)

### isAgentSchema

Checks whether a candidate implements Standard Schema v1.

**Example**

```ts
if (isAgentSchema(value)) value["~standard"].validate(input);
```

**Signature**

```ts
declare const isAgentSchema: (value: unknown) => value is StandardSchemaV1;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-validation-schema.ts#L83)

### isAgentSchemaEffect

Checks the Standard Schema v1 protocol without throwing.

**Example**

```ts
const valid = Effect.runSync(isAgentSchemaEffect(z.string()));
```

**Signature**

```ts
declare const isAgentSchemaEffect: (value: unknown) => Effect.Effect<boolean, never, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-validation-schema.ts#L66)

## `agent-validation-value.ts`

### isPositiveInteger

Checks a finite positive integer for existing synchronous callers.

**Example**

```ts
if (isPositiveInteger(value)) console.log(value + 1);
```

**Signature**

```ts
declare const isPositiveInteger: (value: unknown) => value is number;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-validation-value.ts#L82)

### isPositiveIntegerEffect

Checks for a finite positive integer without throwing.

**Example**

```ts
const valid = Effect.runSync(isPositiveIntegerEffect(3));
```

**Signature**

```ts
declare const isPositiveIntegerEffect: (value: unknown) => Effect.Effect<boolean, never, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-validation-value.ts#L65)

### isRecord

Checks a record for existing synchronous callers.

**Example**

```ts
if (isRecord(value)) console.log(value.id);
```

**Signature**

```ts
declare const isRecord: (value: unknown) => value is Record<PropertyKey, unknown>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-validation-value.ts#L111)

### isRecordEffect

Checks a non-null, non-array record through an Effect operation.

**Example**

```ts
const valid = Effect.runSync(isRecordEffect({ id: "one" }));
```

**Signature**

```ts
declare const isRecordEffect: (value: unknown) => Effect.Effect<boolean, never, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-validation-value.ts#L94)

### positiveInteger

Validates a finite positive integer for existing synchronous callers.

**Throws**

TypeError when the value is not a finite positive integer.

**Example**

```ts
const limit = positiveInteger(3, "maxSteps");
```

**Signature**

```ts
declare const positiveInteger: (value: unknown, name: string) => number;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-validation-value.ts#L45)

### positiveIntegerEffect

Validates a finite positive integer with a typed Effect failure.

**Example**

```ts
const limit = Effect.runSync(positiveIntegerEffect(3, "maxSteps"));
```

**Signature**

```ts
declare const positiveIntegerEffect: (
  value: unknown,
  name: string,
) => Effect.Effect<number, AgentValidationError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-validation-value.ts#L18)

## `agent-validation.ts`

### "./agent-validation-error.js" (namespace export)

Re-exports all named exports from the "./agent-validation-error.js" module.

**Signature**

```ts
export * from "./agent-validation-error.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-validation.ts#L1)

### "./agent-validation-schema.js" (namespace export)

Re-exports all named exports from the "./agent-validation-schema.js" module.

**Signature**

```ts
export * from "./agent-validation-schema.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-validation.ts#L2)

### "./agent-validation-value.js" (namespace export)

Re-exports all named exports from the "./agent-validation-value.js" module.

**Signature**

```ts
export * from "./agent-validation-value.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/agent-validation.ts#L3)

## `approval-core.ts`

### APPROVAL_STATES

**Signature**

```ts
declare const APPROVAL_STATES: readonly ["pending", "approved", "denied"];
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval-core.ts#L18)

### approveApprovalValue

Grants a pending approval.

**Throws**

ApprovalStateError for an invalid transition.

**Example**

```ts
approveApprovalValue(pending);
```

**Signature**

```ts
declare const approveApprovalValue: (approval: ApprovalRecord) => ApprovedApproval;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval-core.ts#L55)

### assertApprovalGrantedValue

Checks whether execution is approved.

**Throws**

ApprovalRequiredError, ApprovalDeniedError, or ApprovalStateError.

**Example**

```ts
assertApprovalGrantedValue(approved);
```

**Signature**

```ts
declare const assertApprovalGrantedValue: (
  approval: ApprovalRecord,
) => asserts approval is ApprovedApproval;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval-core.ts#L77)

### createApprovalValue

Constructs a canonical approval record.

**Throws**

TypeError or ApprovalStateError for invalid metadata.

**Example**

```ts
createApprovalValue(options);
```

**Signature**

```ts
declare const createApprovalValue: (options: ApprovalOptions) => ApprovalRecord;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval-core.ts#L44)

### denyApprovalValue

Denies a pending approval.

**Throws**

ApprovalStateError for an invalid transition.

**Example**

```ts
denyApprovalValue(pending);
```

**Signature**

```ts
declare const denyApprovalValue: (approval: ApprovalRecord) => DeniedApproval;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval-core.ts#L66)

### isApprovalRecordValue

Recognizes canonical approval records.

**Example**

```ts
isApprovalRecordValue(value);
```

**Signature**

```ts
declare const isApprovalRecordValue: (value: unknown) => value is ApprovalRecord;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval-core.ts#L90)

### requiresApprovalValue

Computes whether a policy requires approval.

**Throws**

TypeError for invalid inputs.

**Example**

```ts
requiresApprovalValue("always", "read");
```

**Signature**

```ts
declare const requiresApprovalValue: (
  policy: ApprovalPolicy,
  sideEffect: ApprovalSideEffect,
) => boolean;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval-core.ts#L27)

## `approval-effect-error.ts`

### ApprovalEffectError (class)

Tagged failure for an invalid approval or denied execution.

**Signature**

```ts
declare class ApprovalEffectError
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval-effect-error.ts#L9)

### approvalEffectError

Preserves an approval error for typed Effect recovery and compatibility adapters.

**Example**

```ts
approvalEffectError(new ApprovalStateError("invalid state"));
```

**Signature**

```ts
declare const approvalEffectError: (cause: unknown) => ApprovalEffectError;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval-effect-error.ts#L19)

## `approval-error.ts`

### ApprovalDeniedError (class)

Execution was attempted after an approval was denied.

**Example**

```ts
throw new ApprovalDeniedError(denied);
```

**Signature**

```ts
declare class ApprovalDeniedError { constructor(readonly approval: DeniedApproval) }
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval-error.ts#L28)

### code (property)

**Signature**

```ts
readonly code: "RELKIT_APPROVAL_DENIED"
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval-error.ts#L29)

### ApprovalRequiredError (class)

Execution was attempted while an approval remains pending.

**Example**

```ts
throw new ApprovalRequiredError(pending);
```

**Signature**

```ts
declare class ApprovalRequiredError { constructor(readonly approval: PendingApproval) }
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval-error.ts#L17)

### code (property)

**Signature**

```ts
readonly code: "RELKIT_APPROVAL_REQUIRED"
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval-error.ts#L18)

### ApprovalStateError (class)

A malformed approval or invalid state transition.

**Example**

```ts
throw new ApprovalStateError("Cannot transition approved approval");
```

**Signature**

```ts
declare class ApprovalStateError {
  constructor(message: string);
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval-error.ts#L6)

### code (property)

**Signature**

```ts
readonly code: "RELKIT_APPROVAL_STATE_INVALID"
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval-error.ts#L7)

## `approval.ts`

### approveApproval

Moves a pending approval to the approved state.

**Throws**

ApprovalStateError for a malformed or final decision.

**Example**

```ts
import { approveApproval, createApproval } from "@relkit/app/agents";

const pending = createApproval({
  invocationId: "run",
  toolCallId: "call",
  toolId: "send",
  sideEffect: "write",
  policy: "always",
});
const approved = approveApproval(pending);
void approved;
```

**Signature**

```ts
declare const approveApproval: (approval: ApprovalRecord) => ApprovedApproval;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.ts#L106)

Since v0.4.0

### denyApproval

Moves a pending approval to the denied state.

**Throws**

ApprovalStateError for a malformed or final decision.

**Example**

```ts
import { createApproval, denyApproval } from "@relkit/app/agents";

const pending = createApproval({
  invocationId: "run",
  toolCallId: "call",
  toolId: "send",
  sideEffect: "write",
  policy: "always",
});
const denied = denyApproval(pending);
void denied;
```

**Signature**

```ts
declare const denyApproval: (approval: ApprovalRecord) => DeniedApproval;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.ts#L139)

Since v0.4.0

### "./approval.types.js" (namespace export)

Re-exports all named exports from the "./approval.types.js" module.

**Signature**

```ts
export * from "./approval.types.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.ts#L28)

### APPROVAL_STATES

**Signature**

```ts
declare const APPROVAL_STATES: readonly ["pending", "approved", "denied"];
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.ts#L21)

### ApprovalDeniedError

**Signature**

```ts
declare const ApprovalDeniedError: typeof ApprovalDeniedError;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.ts#L23)

### ApprovalEffectError

**Signature**

```ts
declare const ApprovalEffectError: typeof ApprovalEffectError;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.ts#L27)

### ApprovalRequiredError

**Signature**

```ts
declare const ApprovalRequiredError: typeof ApprovalRequiredError;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.ts#L24)

### ApprovalStateError

**Signature**

```ts
declare const ApprovalStateError: typeof ApprovalStateError;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.ts#L25)

### approveApprovalEffect

Moves a pending approval to the approved state.

**Example**

```ts
Effect.runSync(approveApprovalEffect(pending));
```

**Signature**

```ts
declare const approveApprovalEffect: (
  approval: ApprovalRecord,
) => Effect.Effect<ApprovedApproval, ApprovalEffectError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.ts#L82)

### assertApprovalGranted

Rejects execution unless the record is approved.

**Throws**

ApprovalRequiredError, ApprovalDeniedError, or ApprovalStateError.

**Example**

```ts
assertApprovalGranted(approved);
```

**Signature**

```ts
declare const assertApprovalGranted: (
  approval: ApprovalRecord,
) => asserts approval is ApprovedApproval;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.ts#L160)

### assertApprovalGrantedEffect

Fails unless the record was approved.

**Example**

```ts
Effect.runSync(assertApprovalGrantedEffect(approved));
```

**Signature**

```ts
declare const assertApprovalGrantedEffect: (
  approval: ApprovalRecord,
) => Effect.Effect<void, ApprovalEffectError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.ts#L148)

### createApproval

Creates an immutable pending or policy-approved record.

**Throws**

TypeError or ApprovalStateError for invalid metadata.

**Example**

```ts
createApproval({
  invocationId: "run",
  toolCallId: "call",
  toolId: "send",
  sideEffect: "write",
  policy: "always",
});
```

**Signature**

```ts
declare const createApproval: (options: ApprovalOptions) => ApprovalRecord;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.ts#L73)

### createApprovalEffect

Creates an immutable pending or policy-approved record.

**Example**

```ts
Effect.runSync(createApprovalEffect(options));
```

**Signature**

```ts
declare const createApprovalEffect: (
  options: ApprovalOptions,
) => Effect.Effect<ApprovalRecord, ApprovalEffectError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.ts#L61)

### denyApprovalEffect

Moves a pending approval to the denied state.

**Example**

```ts
Effect.runSync(denyApprovalEffect(pending));
```

**Signature**

```ts
declare const denyApprovalEffect: (
  approval: ApprovalRecord,
) => Effect.Effect<DeniedApproval, ApprovalEffectError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.ts#L115)

### isApprovalRecord

Checks whether a value is a canonical approval record.

**Example**

```ts
if (isApprovalRecord(value)) console.log(value.state);
```

**Signature**

```ts
declare const isApprovalRecord: (value: unknown) => value is ApprovalRecord;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.ts#L181)

### isApprovalRecordEffect

Checks whether a value is a canonical approval record.

**Example**

```ts
Effect.runSync(isApprovalRecordEffect(value));
```

**Signature**

```ts
declare const isApprovalRecordEffect: (value: unknown) => Effect.Effect<boolean, never, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.ts#L171)

### requiresApproval

Tests whether a tool call needs an explicit approval decision.

**Throws**

TypeError for an invalid policy or side effect.

**Example**

```ts
requiresApproval("on-write", "write");
```

**Signature**

```ts
declare const requiresApproval: (policy: ApprovalPolicy, sideEffect: ApprovalSideEffect) => boolean;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.ts#L52)

### requiresApprovalEffect

Tests whether a tool call needs an explicit approval decision.

**Example**

```ts
Effect.runSync(requiresApprovalEffect("on-write", "write"));
```

**Signature**

```ts
declare const requiresApprovalEffect: (
  policy: FunctionToolApproval,
  sideEffect: FunctionToolSideEffect,
) => Effect.Effect<boolean, ApprovalEffectError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.ts#L36)

## `approval.types.ts`

### ApprovalMetadata (interface)

Argument-free metadata for one invocation and tool-call decision.

**Signature**

```ts
export interface ApprovalMetadata extends ApprovalOptions {
  readonly required: boolean;
  readonly state: ApprovalState;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.types.ts#L20)

### ApprovalOptions (interface)

Inputs used to create an approval record.

**Signature**

```ts
export interface ApprovalOptions {
  readonly invocationId: string;
  readonly toolCallId: string;
  readonly toolId: string;
  readonly sideEffect: ApprovalSideEffect;
  readonly policy: ApprovalPolicy;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.types.ts#L11)

### ApprovalPolicy (type alias)

Policy controlling which tool calls require approval.

**Signature**

```ts
type ApprovalPolicy = ToolApproval;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.types.ts#L6)

### ApprovalRecord (type alias)

Canonical approval record in any valid state.

**Signature**

```ts
type ApprovalRecord = PendingApproval | ApprovedApproval | DeniedApproval;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.types.ts#L41)

### ApprovalSideEffect (type alias)

Declared side effect of a tool call.

**Signature**

```ts
type ApprovalSideEffect = ToolSideEffect;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.types.ts#L8)

### ApprovalState (type alias)

One canonical approval state.

**Signature**

```ts
type ApprovalState = "pending" | "approved" | "denied";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.types.ts#L4)

### ApprovedApproval (interface)

Approval granted by policy or an explicit decision.

**Signature**

```ts
export interface ApprovedApproval extends ApprovalMetadata {
  readonly state: "approved";
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.types.ts#L31)

### DeniedApproval (interface)

Approval explicitly denied.

**Signature**

```ts
export interface DeniedApproval extends ApprovalMetadata {
  readonly state: "denied";
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.types.ts#L36)

### PendingApproval (interface)

Approval that must receive a decision before execution.

**Signature**

```ts
export interface PendingApproval extends ApprovalMetadata {
  readonly state: "pending";
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/approval.types.ts#L26)

## `capture-content.ts`

### captureAgentContent

Captures redacted content for synchronous runtime callers.

**Example**

```ts
const record = captureAgentContent({ token: "secret" }, policy);
```

**Signature**

```ts
declare const captureAgentContent: (
  value: unknown,
  policy: AgentCapturePolicy,
) => AgentCaptureRecord | undefined;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/capture-content.ts#L55)

### captureAgentContentEffect

Redacts and bounds a JSON-compatible agent value.

**Example**

```ts
const record = Effect.runSync(captureAgentContentEffect({ token: "secret" }, policy));
```

**Signature**

```ts
declare const captureAgentContentEffect: (
  value: unknown,
  policy: AgentCapturePolicy,
) => Effect.Effect<AgentCaptureRecord | undefined, never, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/capture-content.ts#L18)

## `capture-policy.ts`

### AgentCapturePolicyError (class)

Invalid capture configuration in the Effect error channel.

**Signature**

```ts
declare class AgentCapturePolicyError
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/capture-policy.ts#L19)

### createAgentCapturePolicy

Creates a capture policy for synchronous descriptor callers.

**Throws**

TypeError when mode, size, or redaction keys are invalid.

**Example**

```ts
const policy = createAgentCapturePolicy({ mode: "development-redacted", maxBytes: 1024 });
```

**Signature**

```ts
declare const createAgentCapturePolicy: (
  value: AgentCapturePolicy | undefined,
) => AgentCapturePolicy;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/capture-policy.ts#L89)

### createAgentCapturePolicyEffect

Validates and freezes a content capture policy.

**Example**

```ts
const policy = Effect.runSync(createAgentCapturePolicyEffect({ mode: "off" }));
```

**Signature**

```ts
declare const createAgentCapturePolicyEffect: (
  value: AgentCapturePolicy | undefined,
) => Effect.Effect<AgentCapturePolicy, AgentCapturePolicyError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/capture-policy.ts#L32)

## `capture-span.ts`

### createAgentSpanCapture

Combines captured input and output for synchronous runtime callers.

**Example**

```ts
const capture = createAgentSpanCapture(input, output);
```

**Signature**

```ts
declare const createAgentSpanCapture: (
  input: AgentCaptureRecord | undefined,
  output: AgentCaptureRecord | undefined,
) => AgentSpanCapture | undefined;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/capture-span.ts#L37)

### createAgentSpanCaptureEffect

Combines optional captured input and output for an agent span.

**Example**

```ts
const capture = Effect.runSync(createAgentSpanCaptureEffect(input, output));
```

**Signature**

```ts
declare const createAgentSpanCaptureEffect: (
  input: AgentCaptureRecord | undefined,
  output: AgentCaptureRecord | undefined,
) => Effect.Effect<
  Readonly<{ output?: AgentCaptureRecord; input?: AgentCaptureRecord }> | undefined,
  never,
  never
>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/capture-span.ts#L16)

## `capture.ts`

### "./capture-content.js" (namespace export)

Re-exports all named exports from the "./capture-content.js" module.

**Signature**

```ts
export * from "./capture-content.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/capture.ts#L2)

### "./capture-policy.js" (namespace export)

Re-exports all named exports from the "./capture-policy.js" module.

**Signature**

```ts
export * from "./capture-policy.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/capture.ts#L1)

### "./capture-span.js" (namespace export)

Re-exports all named exports from the "./capture-span.js" module.

**Signature**

```ts
export * from "./capture-span.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/capture.ts#L3)

### AgentCapturePolicy

**Signature**

```ts
declare const AgentCapturePolicy: AgentCapturePolicy;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/capture.ts#L4)

### AgentCaptureRecord

**Signature**

```ts
declare const AgentCaptureRecord: AgentCaptureRecord;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/capture.ts#L4)

### AgentSpanCapture

**Signature**

```ts
declare const AgentSpanCapture: AgentSpanCapture;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/capture.ts#L4)

## `capture.types.ts`

### AgentCapturePolicy (interface)

Controls whether an agent may retain redacted content in its spans.
Development capture requires a positive byte limit; off ignores the other fields.

**Example**

```ts
const policy: AgentCapturePolicy = { mode: "development-redacted", maxBytes: 1024 };
```

**Signature**

```ts
export interface AgentCapturePolicy {
  readonly mode: "off" | "development-redacted";
  readonly maxBytes?: number;
  readonly redactKeys?: readonly string[];
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/capture.types.ts#L10)

### AgentCaptureRecord (interface)

Captured JSON and its encoded size, or a marker when capture was truncated.
The content property is absent whenever truncated is true.

**Example**

```ts
const record: AgentCaptureRecord = { mode: "development-redacted", bytes: 0, truncated: true };
```

**Signature**

```ts
export interface AgentCaptureRecord {
  readonly mode: "development-redacted";
  readonly bytes: number;
  readonly truncated: boolean;
  readonly content?: JsonValue;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/capture.types.ts#L23)

### AgentSpanCapture (interface)

Optional input and output captures attached to one agent span.
Absent fields were disabled or unavailable at capture time.

**Example**

```ts
const capture: AgentSpanCapture = {
  input: { mode: "development-redacted", bytes: 0, truncated: true },
};
```

**Signature**

```ts
export interface AgentSpanCapture {
  readonly input?: AgentCaptureRecord;
  readonly output?: AgentCaptureRecord;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/capture.types.ts#L39)

## `client-contract-metadata.ts`

Projects generic RELKIT tool references and public event schemas into client metadata.
Native middleware, graph state and SDK schema projection remain in @relkit/langchain.

### "./client-contract-metadata.types.js" (namespace export)

Re-exports all named exports from the "./client-contract-metadata.types.js" module.

**Signature**

```ts
export * from "./client-contract-metadata.types.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-metadata.ts#L16)

### agentClientContractMetadata

Projects generic metadata for synchronous authoring.

**Throws**

The original metadata projection error.

**Signature**

```ts
declare const agentClientContractMetadata: (
  options: AgentClientMetadataOptions,
) => AgentClientContractMetadata;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-metadata.ts#L51)

### agentClientContractMetadataEffect

Projects an ordinary agent's public contract without evaluating native schemas.

**Signature**

```ts
declare const agentClientContractMetadataEffect: (
  options: AgentClientMetadataOptions,
) => Effect.Effect<AgentClientContractMetadata, AgentDefinitionFailure, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-metadata.ts#L22)

## `client-contract-metadata.types.ts`

Declares serializable agent client contract metadata shared by SDK-free authoring, graph normalization and runtime client projections. This companion contains the shared planning contracts without executing work.

### AgentClientContractMetadata (interface)

Complete metadata needed to generate an agent client contract.

**Signature**

```ts
export interface AgentClientContractMetadata {
  readonly tools: readonly ClientToolMetadata[];
  readonly state: readonly ClientTypeField[];
  readonly events: readonly ClientEventMetadata[];
  readonly scopes: readonly ClientScopeMetadata[];
  readonly waiting: readonly ClientWaitingMetadata[];
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-metadata.types.ts#L32)

### AgentClientMetadataOptions (interface)

Inputs for native agent client metadata.

**Signature**

```ts
export interface AgentClientMetadataOptions {
  readonly id: string;
  readonly tools: readonly ToolRefAny[];
  readonly middleware?: readonly [];
  readonly client?: AgentClientPolicy;
  readonly subagents?: readonly SubagentMetadataSource[];
  readonly interruptOn?: Readonly<Record<string, unknown>>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-metadata.types.ts#L47)

### ClientEventMetadata (type alias)

Client visible event schema or dynamic event marker.

**Signature**

```ts
type ClientEventMetadata = ClientTypeField | { readonly kind: "dynamic" };
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-metadata.types.ts#L8)

### ClientScopeMetadata (interface)

Client visible agent, subagent, or graph node scope.

**Signature**

```ts
export interface ClientScopeMetadata {
  readonly kind: "agent" | "subagent" | "node" | "dynamic";
  readonly id?: string;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-metadata.types.ts#L20)

### ClientToolMetadata (type alias)

Client visible tool schema or dynamic tool marker.

**Signature**

```ts
type ClientToolMetadata =
  | {
      readonly id: string;
      readonly input: ClientSchemaMetadata;
      readonly output: ClientSchemaMetadata;
    }
  | { readonly kind: "dynamic" };
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-metadata.types.ts#L11)

### ClientWaitingMetadata (interface)

Client visible continuation response schema.

**Signature**

```ts
export interface ClientWaitingMetadata {
  readonly scope: ClientScopeMetadata;
  readonly response: ClientSchemaMetadata;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-metadata.types.ts#L26)

### SubagentMetadataSource (interface)

Source of nested subagent scope identities.

**Signature**

```ts
export interface SubagentMetadataSource {
  readonly id: string;
  readonly subagents?: readonly SubagentMetadataSource[];
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-metadata.types.ts#L41)

## `client-contract-schema.ts`

Describes Standard Schema input and output contracts for generic agent clients without importing a native model or graph SDK.

### ClientSchemaMetadata

**Signature**

```ts
declare const ClientSchemaMetadata: ClientSchemaMetadata;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-schema.ts#L10)

### ClientTypeField

**Signature**

```ts
declare const ClientTypeField: ClientTypeField;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-schema.ts#L10)

### clientSchemaMetadata

Synchronously projects schema metadata for existing descriptor callers.

**Example**

```ts
const metadata = clientSchemaMetadata({ type: "string" });
```

**Signature**

```ts
declare const clientSchemaMetadata: (value: unknown) => ClientSchemaMetadata;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-schema.ts#L143)

### clientSchemaMetadataEffect

Projects a schema-like value to safe client metadata.

**Example**

```ts
const metadata = Effect.runSync(clientSchemaMetadataEffect({ type: "string" }));
```

**Signature**

```ts
declare const clientSchemaMetadataEffect: (
  value: unknown,
) => Effect.Effect<ClientSchemaMetadata, never, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-schema.ts#L115)

### dynamicClientSchema

Marker for a schema that cannot be represented in the client contract.

**Signature**

```ts
declare const dynamicClientSchema: Readonly<{ kind: "dynamic" }>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-schema.ts#L13)

### mergeClientSchemas

Synchronously merges client schemas for existing descriptor callers.

**Example**

```ts
const schema = mergeClientSchemas([{ type: "object" }]);
```

**Signature**

```ts
declare const mergeClientSchemas: (values: readonly unknown[]) => ClientSchemaMetadata;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-schema.ts#L53)

### mergeClientSchemasEffect

Merges projected object schemas while preserving input order.

**Example**

```ts
const schema = Effect.runSync(mergeClientSchemasEffect([{ type: "object" }]));
```

**Signature**

```ts
declare const mergeClientSchemasEffect: (
  values: ReadonlyArray<unknown>,
) => Effect.Effect<JsonValue, never, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-schema.ts#L27)

### selectedClientFields

Synchronously selects client fields for existing descriptor callers.

**Example**

```ts
const fields = selectedClientFields({ type: "object" }, ["name"]);
```

**Signature**

```ts
declare const selectedClientFields: (
  schema: ClientSchemaMetadata,
  keys?: readonly string[],
) => readonly ClientTypeField[];
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-schema.ts#L100)

### selectedClientFieldsEffect

Selects named client state fields from a projected object schema.

**Example**

```ts
const fields = Effect.runSync(selectedClientFieldsEffect({ type: "object" }, ["name"]));
```

**Signature**

```ts
declare const selectedClientFieldsEffect: (
  schema: ClientSchemaMetadata,
  keys?: ReadonlyArray<string> | undefined,
) => Effect.Effect<ReadonlyArray<ClientTypeField>, never, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-schema.ts#L66)

## `client-contract-schema.types.ts`

### ClientSchemaMetadata (type alias)

A projected JSON Schema fragment or an intentionally dynamic field.

**Signature**

```ts
type ClientSchemaMetadata = JsonValue | { readonly kind: "dynamic" };
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-schema.types.ts#L4)

### ClientTypeField (interface)

One client-visible state field with its projected schema.

**Signature**

```ts
export interface ClientTypeField {
  readonly name: string;
  readonly schema: ClientSchemaMetadata;
  readonly optional?: true;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-contract-schema.types.ts#L7)

## `client-events.ts`

Projects durable agent journal records into bounded client lifecycle events while preserving tool identity and declared public values.

### AgentClientEvent

**Signature**

```ts
declare const AgentClientEvent: AgentClientEvent;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-events.ts#L12)

### AgentProgressEvent

**Signature**

```ts
declare const AgentProgressEvent: AgentProgressEvent;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-events.ts#L12)

### AgentToolEvent

**Signature**

```ts
declare const AgentToolEvent: AgentToolEvent;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-events.ts#L12)

### agentClientEvents

Projects a journal record for existing synchronous client callers.

**Example**

```ts
const events = agentClientEvents(record);
```

**Signature**

```ts
declare const agentClientEvents: (record: JournalRecord) => readonly AgentClientEvent[];
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-events.ts#L40)

### agentClientEventsEffect

Projects one journal record into ordered, public client events.

**Example**

```ts
const events = Effect.runSync(agentClientEventsEffect(record));
```

**Signature**

```ts
declare const agentClientEventsEffect: (
  record: JournalRecord,
) => Effect.Effect<ReadonlyArray<AgentClientEvent>, never, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-events.ts#L24)

## `client-tool-events.ts`

Projects tool message parts into stable public event identities in authored order.

### toolClientEvents

**Signature**

```ts
declare const toolClientEvents: (
  base: ClientEventBase,
  message: BrowserMessage,
) => readonly AgentClientEvent[];
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/client-tool-events.ts#L6)

## `define-agent-build.ts`

Validates generic authoring inputs before binding a descriptor identity.
Native fields are rejected with their integration import so no capability is silently ignored.

### prepareAgentDescriptor

Prepares immutable generic metadata before applying its stable identity.

**Throws**

TypeError for unsupported native fields or invalid generic inputs.

**Signature**

```ts
declare const prepareAgentDescriptor: <
  const Id extends string,
  const InputSchema extends StandardSchemaV1,
  const OutputSchema extends StandardSchemaV1,
  const Tools extends readonly ToolRefAny[],
>(
  options: DefineAgentOptions<Id, InputSchema, OutputSchema, Tools>,
) => (
  id: Id,
) => AgentDescriptor<
  Id,
  InferInput<InputSchema>,
  InferOutput<OutputSchema>,
  InputSchema,
  OutputSchema,
  Tools
>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent-build.ts#L25)

## `define-agent-error.ts`

### AgentDefinitionFailure (class)

Tagged validation failure while copying an agent definition.

**Signature**

```ts
declare class AgentDefinitionFailure
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent-error.ts#L4)

### agentDefinitionFailure

Preserves the original authoring error in a tagged Effect failure.

**Example**

```ts
agentDefinitionFailure(new TypeError("invalid"));
```

**Signature**

```ts
declare const agentDefinitionFailure: (cause: unknown) => AgentDefinitionFailure;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent-error.ts#L14)

## `define-agent-limits.ts`

### copyAgentLimits

Copies limits for existing synchronous authoring callers.

**Throws**

The original invalid limits TypeError.

**Example**

```ts
const limits = copyAgentLimits({ maxSteps: 3, maxToolCalls: 2, timeoutMs: 1000 });
```

**Signature**

```ts
declare const copyAgentLimits: (value: unknown) => AgentLimits;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent-limits.ts#L38)

### copyAgentLimitsEffect

Validates and freezes an agent's execution limits.

**Example**

```ts
Effect.runSync(copyAgentLimitsEffect({ maxSteps: 3, maxToolCalls: 2, timeoutMs: 1000 }));
```

**Signature**

```ts
declare const copyAgentLimitsEffect: (
  value: unknown,
) => Effect.Effect<
  Readonly<{ maxSteps: number; maxToolCalls: number; timeoutMs: number }>,
  AgentDefinitionFailure,
  never
>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent-limits.ts#L12)

## `define-agent-support.ts`

### copyAgentInstructions

Copies instructions for existing synchronous authoring callers.

**Throws**

The original invalid instruction error.

**Example**

```ts
const instructions = copyAgentInstructions("Answer clearly");
```

**Signature**

```ts
declare const copyAgentInstructions: (value: unknown) => AgentInstructions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent-support.ts#L31)

### copyAgentInstructionsEffect

Validates and freezes agent instructions.

**Example**

```ts
Effect.runSync(copyAgentInstructionsEffect("Answer clearly"));
```

**Signature**

```ts
declare const copyAgentInstructionsEffect: (
  value: unknown,
) => Effect.Effect<AgentInstructions, AgentDefinitionFailure, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent-support.ts#L16)

### isAgentInstructions

Checks instructions for existing synchronous authoring callers.

**Example**

```ts
if (isAgentInstructions(value)) use(value);
```

**Signature**

```ts
declare const isAgentInstructions: (value: unknown) => value is AgentInstructions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent-support.ts#L63)

### isAgentInstructionsEffect

Checks whether a value is an agent instruction descriptor.

**Example**

```ts
Effect.runSync(isAgentInstructionsEffect("Answer clearly"));
```

**Signature**

```ts
declare const isAgentInstructionsEffect: (value: unknown) => Effect.Effect<boolean, never, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent-support.ts#L53)

## `define-agent-validation.ts`

Validates generic agent descriptors and selector models before assembly, rejecting native execution options with an explicit integration import diagnostic.

### assertAgentDescriptor

Requires a descriptor for existing synchronous authoring callers.

**Throws**

TypeError when the descriptor is invalid.

**Example**

```ts
assertAgentDescriptor(candidate);
```

**Signature**

```ts
declare const assertAgentDescriptor: (value: unknown) => asserts value is AgentAny;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent-validation.ts#L75)

### assertAgentDescriptorEffect

Requires a valid agent descriptor.

**Example**

```ts
Effect.runSync(assertAgentDescriptorEffect(agent));
```

**Signature**

```ts
declare const assertAgentDescriptorEffect: (
  value: unknown,
) => Effect.Effect<void, AgentDefinitionFailure, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent-validation.ts#L58)

### isAgentDescriptor

Checks a descriptor for existing synchronous authoring callers.

**Example**

```ts
if (isAgentDescriptor(candidate)) use(candidate);
```

**Signature**

```ts
declare const isAgentDescriptor: (value: unknown) => value is AgentAny;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent-validation.ts#L29)

### isAgentDescriptorEffect

Checks the complete runtime shape of an agent descriptor.

**Example**

```ts
Effect.runSync(isAgentDescriptorEffect(candidate));
```

**Signature**

```ts
declare const isAgentDescriptorEffect: (value: unknown) => Effect.Effect<boolean, never, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent-validation.ts#L19)

### normalizeAgentModel

Normalizes a model for existing synchronous authoring callers.

**Throws**

The original invalid selector error.

**Example**

```ts
const model = normalizeAgentModel("openai:gpt");
```

**Signature**

```ts
declare const normalizeAgentModel: (value: string | undefined) => string | undefined;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent-validation.ts#L104)

### normalizeAgentModelEffect

Normalizes the selector of a string model definition.

**Example**

```ts
Effect.runSync(normalizeAgentModelEffect("openai:gpt"));
```

**Signature**

```ts
declare const normalizeAgentModelEffect: (
  value: string | undefined,
) => Effect.Effect<string | undefined, AgentDefinitionFailure, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent-validation.ts#L88)

## `define-agent.ts`

Builds plain agent descriptors without loading an execution SDK.
The compiler selects native execution when an application actually declares agents.

### defineAgent

Defines an SDK-independent agent using validated schemas and RELKIT tool references.

**Throws**

The original authoring validation or identity error.

**Example**

```ts
import { defineAgent } from "@relkit/app/agents";
import { z } from "@relkit/app/schema";

const support = defineAgent({
  id: "support",
  input: z.object({ message: z.string() }),
  output: z.object({ answer: z.string() }),
  instructions: "Reply briefly.",
  tools: [],
  limits: { maxSteps: 4, maxToolCalls: 2, timeoutMs: 30_000 },
});
void support;
```

**Signature**

```ts
declare const defineAgent: <
  const Id extends string,
  const InputSchema extends StandardSchemaV1,
  const OutputSchema extends StandardSchemaV1,
  const Tools extends readonly ToolRefAny[],
>(
  options: DefineAgentOptions<Id, InputSchema, OutputSchema, Tools>,
) => AgentDescriptor<
  Id,
  InferInput<InputSchema>,
  InferOutput<OutputSchema>,
  InputSchema,
  OutputSchema,
  Tools
>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent.ts#L82)

Since v0.4.0

#### Backend and frontend example

This SDK-independent factory describes the client contract. The runnable example below uses `defineAgent` from `@relkit/langchain` to supply native execution; see [agent setup](/docs/modules/ai/agents) for the required integration and runtime bindings.

**Backend** — these maintained files define the operation used by the frontend below.

```ts title="templates/default/v1/agent/src/services/hello/agents/assistant.agent.ts"
/** Runs an offline greeting agent with RELKIT/native tools, todo middleware and public state observation. */
import { defineAgent } from "@relkit/langchain";
import { z } from "@relkit/app/schema";
import { FakeToolCallingModel, todoListMiddleware, tool } from "langchain";
import lookup from "@app/services/hello/tools/lookup.tool.js";

export const uppercase = tool(async ({ text }: { readonly text: string }) => text.toUpperCase(), {
  name: "uppercase",
  description: "Uppercase text without leaving the process",
  schema: z.object({ text: z.string() }),
});

export default defineAgent({
  id: "hello.assistant",

  input: z.object({ message: z.string().min(1) }),
  output: z.object({ answer: z.string() }),

  model: new FakeToolCallingModel({
    toolCalls: [
      [
        {
          name: "write_todos",
          args: { todos: [{ content: "Answer the greeting", status: "completed" }] },
          id: "todo-1",
        },
      ],
      [
        {
          name: "relkit_output",
          args: { value: { answer: "Hello from the offline LangChain model." } },
          id: "output-1",
        },
      ],
    ],
  }),
  instructions: "Answer greeting questions with the available tools.",
  tools: [lookup, uppercase],
  middleware: [todoListMiddleware()],
  stateProfile: "default",
  client: {
    public: true,
    state: ["todos"],
    events: { notice: z.object({ message: z.string() }) },
  },
  chat: { input: "message", output: "answer" },
  controls: ["stop"],

  limits: {
    maxSteps: 4,
    maxToolCalls: 4,
    timeoutMs: 10_000,
  },
});
```

**Frontend**

After [frontend setup and pulling the greeting agent's contract](/guides/frontend/connect-react),
render this component under the provider. Supply a stable business `threadId` owned by your
application, such as the ID of the conversation the user opened:

```tsx title="src/Assistant.tsx"
"use client";

/** Sends one greeting to the documented hello.assistant agent and observes its typed answer. */
import { useAgent, useRelkitClient } from "@relkit/client/react";
import { useState } from "react";

/** Keeps the application-owned thread identity stable across rendering and observation.
 * @param props - Authorized conversation identity retained by the application.
 * @returns A greeting action, the observed answer, and explicit submission failure. */
export function Assistant({ threadId }: { readonly threadId: string }) {
  const { status } = useRelkitClient();
  const assistant = useAgent("hello.assistant");
  const [failure, setFailure] = useState("");

  /** Submits once and preserves uncertain outcomes for explicit recovery.
   * @returns Completion after acceptance or displaying the failure. */
  async function sendGreeting() {
    try {
      await assistant.send("Hello, RELKIT!", { threadId });
    } catch (error) {
      setFailure(String(error));
    }
  }

  return (
    <section>
      <button
        disabled={status !== "ready" || assistant.status !== "idle" || failure !== ""}
        onClick={sendGreeting}
      >
        Say hello
      </button>
      <p role="status">{assistant.output?.answer ?? assistant.status}</p>
      {failure && <p role="alert">{failure}. Check this thread before submitting again.</p>}
    </section>
  );
}
```

This is the same `hello.assistant` declaration: `client.public` exposes it, `chat.input: "message"`
makes `send` accept a string, and `chat.output: "answer"` selects its typed answer. Mounting
`useAgent` does not start a run. The backend owns models, credentials, tools, and authorization.

Reference: [`useAgent`](/docs/api/client#useagent).
Continue with [streaming and controls](/docs/modules/ai/streaming) or
[thread recovery](/docs/modules/ai/threads-recovery).

### "./define-agent.types.js" (namespace export)

Re-exports all named exports from the "./define-agent.types.js" module.

**Signature**

```ts
export * from "./define-agent.types.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent.ts#L17)

### AgentChatMapping

**Signature**

```ts
declare const AgentChatMapping: AgentChatMapping;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent.ts#L18)

### AgentClientPolicy

**Signature**

```ts
declare const AgentClientPolicy: AgentClientPolicy<Guard, StateKey, Events>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent.ts#L18)

### AgentControl

**Signature**

```ts
declare const AgentControl: AgentControl;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent.ts#L18)

### assertAgentDescriptor

**Signature**

```ts
declare const assertAgentDescriptor: (value: unknown) => asserts value is AgentAny;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent.ts#L15)

### copyAgentLimits

**Signature**

```ts
declare const copyAgentLimits: (value: unknown) => AgentLimits;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent.ts#L16)

### copyAgentLimitsEffect

**Signature**

```ts
declare const copyAgentLimitsEffect: (
  value: unknown,
) => Effect.Effect<
  Readonly<{ maxSteps: number; maxToolCalls: number; timeoutMs: number }>,
  AgentDefinitionFailure,
  never
>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent.ts#L16)

### defineAgentEffect

Validates plain authoring inputs and preserves source identity generation.

**Signature**

```ts
declare const defineAgentEffect: <
  const Id extends string,
  const InputSchema extends StandardSchemaV1,
  const OutputSchema extends StandardSchemaV1,
  const Tools extends readonly ToolRefAny[],
>(
  options: DefineAgentOptions<Id, InputSchema, OutputSchema, Tools>,
) => Effect.Effect<
  AgentDescriptor<
    Id,
    InferInput<InputSchema>,
    InferOutput<OutputSchema>,
    InputSchema,
    OutputSchema,
    Tools
  >,
  AgentDefinitionFailure,
  never
>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent.ts#L24)

### isAgentDescriptor

**Signature**

```ts
declare const isAgentDescriptor: (value: unknown) => value is AgentAny;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent.ts#L15)

## `define-agent.types.ts`

Defines the SDK-independent agent contract used by generic application authoring.
Native model, middleware, graph and persistence APIs are owned by @relkit/langchain.

### AgentDescriptor (interface)

Plain agent metadata; no execution SDK is evaluated by this declaration.

**Signature**

```ts
export interface AgentDescriptor<
  Id extends string,
  Input,
  Output,
  InputSchema extends StandardSchemaV1 = StandardSchemaV1,
  OutputSchema extends StandardSchemaV1 = StandardSchemaV1,
  Tools extends readonly ToolRefAny[] = readonly ToolRefAny[],
>
  extends DescriptorBase<"agent", Id>, AgentRef<Id, InputSchema, OutputSchema> {
  readonly model?: string;
  readonly instructions: AgentInstructions;
  readonly tools: AgentToolReferences<Tools>;
  readonly middleware: readonly [];
  readonly limits: AgentLimits;
  readonly stateProfile?: string;
  readonly client?: AgentClientPolicy<NonNullable<AgentClientPolicy["authorize"]>, never>;
  readonly chat?: AgentChatMapping;
  readonly controls?: readonly AgentControl[];
  readonly clientContract: AgentClientContractMetadata;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent.types.ts#L39)

### AgentInstructions (type alias)

**Signature**

```ts
type AgentInstructions = string | PromptTemplate | PromptInstructions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent.types.ts#L24)

### AgentLimits (interface)

Limits retained by the selected execution integration.

**Signature**

```ts
export interface AgentLimits {
  readonly maxSteps: number;
  readonly maxToolCalls: number;
  readonly timeoutMs: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent.types.ts#L27)

### AgentToolReferences (type alias)

Handler-free tool identities retaining each authored literal reference.

**Signature**

```ts
type AgentToolReferences<Tools extends readonly ToolRefAny[]> = {
  readonly [Index in keyof Tools]: Pick<Tools[Index], "ref">;
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent.types.ts#L34)

### DefineAgentOptions (interface)

Generic agent inputs; native capabilities use the explicit integration facade.

**Signature**

```ts
export interface DefineAgentOptions<
  Id extends string,
  InputSchema extends StandardSchemaV1,
  OutputSchema extends StandardSchemaV1,
  Tools extends readonly ToolRefAny[],
> extends DescriptorMetadata {
  readonly id?: Id;
  readonly input: InputSchema;
  readonly output: OutputSchema;
  readonly model?: string;
  readonly instructions: AgentInstructions;
  readonly tools: Tools;
  readonly middleware?: readonly [];
  readonly limits: AgentLimits;
  readonly stateProfile?: string;
  readonly client?: AgentClientPolicy<NonNullable<AgentClientPolicy["authorize"]>, never>;
  readonly chat?: AgentChatMapping;
  readonly controls?: readonly AgentControl[];
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent.types.ts#L61)

### PromptInstructions (interface)

**Signature**

```ts
export interface PromptInstructions {
  readonly kind: "prompt";
  readonly id: string;
  readonly ref: { readonly kind: "prompt"; readonly id: string };
  readonly value: string | readonly string[];
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent.types.ts#L17)

### PromptTemplate (interface)

**Signature**

```ts
export interface PromptTemplate {
  readonly template: string;
  readonly variables?: readonly string[];
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/define-agent.types.ts#L12)

## `generated-function-error.ts`

### GeneratedAgentFunctionFailure (class)

Tagged invalid generated function identity or executor.

**Signature**

```ts
declare class GeneratedAgentFunctionFailure
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/generated-function-error.ts#L4)

### generatedAgentFunctionFailure

Preserves an invalid generated function error for Effect callers.

**Example**

```ts
generatedAgentFunctionFailure(new TypeError("invalid"));
```

**Signature**

```ts
declare const generatedAgentFunctionFailure: (cause: unknown) => GeneratedAgentFunctionFailure;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/generated-function-error.ts#L14)

## `generated-function.ts`

### "./generated-function.types.js" (namespace export)

Re-exports all named exports from the "./generated-function.types.js" module.

**Signature**

```ts
export * from "./generated-function.types.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/generated-function.ts#L11)

### GENERATED_AGENT_FUNCTION_PREFIX

**Signature**

```ts
declare const GENERATED_AGENT_FUNCTION_PREFIX: "relkit.agent.";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/generated-function.ts#L13)

### GENERATED_AGENT_FUNCTION_SUFFIX

**Signature**

```ts
declare const GENERATED_AGENT_FUNCTION_SUFFIX: ".invoke";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/generated-function.ts#L14)

### GeneratedAgentFunctionUnboundError (class)

Raised when a generated identity is registered before the agent runtime binds an executor.

**Signature**

```ts
declare class GeneratedAgentFunctionUnboundError {
  constructor(functionId: string);
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/generated-function.ts#L17)

### code (property)

**Signature**

```ts
readonly code: "RELKIT_GENERATED_FUNCTION_UNBOUND"
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/generated-function.ts#L18)

### createGeneratedAgentFunction

Creates a marked handler for existing synchronous callers.

**Throws**

The original invalid identity or executor error.

**Example**

```ts
createGeneratedAgentFunction("support", executor);
```

**Signature**

```ts
declare const createGeneratedAgentFunction: (
  agentId: unknown,
  executor?: GeneratedAgentExecutor,
) => GeneratedAgentFunction;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/generated-function.ts#L80)

### createGeneratedAgentFunctionEffect

Creates a marked function handler for a compiler-generated agent identity.

**Example**

```ts
Effect.runSync(createGeneratedAgentFunctionEffect("support", executor));
```

**Signature**

```ts
declare const createGeneratedAgentFunctionEffect: (
  agentId: unknown,
  executor?: GeneratedAgentExecutor | undefined,
) => Effect.Effect<GeneratedAgentFunction, GeneratedAgentFunctionFailure, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/generated-function.ts#L64)

### generatedAgentFunctionId

Derives the generated function ID for existing synchronous callers.

**Throws**

The original invalid identity error.

**Example**

```ts
generatedAgentFunctionId("support");
```

**Signature**

```ts
declare const generatedAgentFunctionId: (agentId: unknown) => string;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/generated-function.ts#L46)

### generatedAgentFunctionIdEffect

Derives the stable generated function ID without using the source path.

**Example**

```ts
Effect.runSync(generatedAgentFunctionIdEffect("support"));
```

**Signature**

```ts
declare const generatedAgentFunctionIdEffect: (
  agentId: unknown,
) => Effect.Effect<string, GeneratedAgentFunctionFailure, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/generated-function.ts#L31)

### isGeneratedAgentFunction

Checks a generated marker for existing synchronous callers.

**Example**

```ts
if (isGeneratedAgentFunction(candidate)) use(candidate);
```

**Signature**

```ts
declare const isGeneratedAgentFunction: (value: unknown) => value is GeneratedAgentFunction;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/generated-function.ts#L128)

### isGeneratedAgentFunctionEffect

Checks whether a callable has a valid generated agent marker.

**Example**

```ts
Effect.runSync(isGeneratedAgentFunctionEffect(candidate));
```

**Signature**

```ts
declare const isGeneratedAgentFunctionEffect: (
  value: unknown,
) => Effect.Effect<boolean, never, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/generated-function.ts#L118)

## `generated-function.types.ts`

### GeneratedAgentExecutor (type alias)

Optional executor bound when the generated function is registered.

**Signature**

```ts
type GeneratedAgentExecutor = (input: unknown, context: unknown) => MaybePromise<unknown>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/generated-function.types.ts#L12)

### GeneratedAgentFunction (type alias)

Callable handler with a compiler-visible agent identity marker.

**Signature**

```ts
type GeneratedAgentFunction = ((...arguments_: readonly unknown[]) => MaybePromise<unknown>) &
  GeneratedAgentFunctionMarker;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/generated-function.types.ts#L15)

### GeneratedAgentFunctionMarker (interface)

Serializable identity attached to an agent-generated function.

**Signature**

```ts
export interface GeneratedAgentFunctionMarker {
  readonly generated: true;
  readonly generatedBy: "agent";
  readonly agentId: string;
  readonly functionId: string;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/generated-function.types.ts#L4)

## `index.ts`

Exposes generic agent authoring, client events and state contracts.
Native models, graphs, middleware and execution are selected through @relkit/langchain.

### "./agent-client.js" (namespace export)

Re-exports all named exports from the "./agent-client.js" module.

**Signature**

```ts
export * from "./agent-client.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/index.ts#L6)

### "./agent-telemetry.js" (namespace export)

Re-exports all named exports from the "./agent-telemetry.js" module.

**Signature**

```ts
export * from "./agent-telemetry.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/index.ts#L12)

### "./approval.js" (namespace export)

Re-exports all named exports from the "./approval.js" module.

**Signature**

```ts
export * from "./approval.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/index.ts#L8)

### "./client-events.js" (namespace export)

Re-exports all named exports from the "./client-events.js" module.

**Signature**

```ts
export * from "./client-events.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/index.ts#L7)

### "./define-agent.js" (namespace export)

Re-exports all named exports from the "./define-agent.js" module.

**Signature**

```ts
export * from "./define-agent.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/index.ts#L5)

### "./generated-function.js" (namespace export)

Re-exports all named exports from the "./generated-function.js" module.

**Signature**

```ts
export * from "./generated-function.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/index.ts#L9)

### "./model-selection.js" (namespace export)

Re-exports all named exports from the "./model-selection.js" module.

**Signature**

```ts
export * from "./model-selection.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/index.ts#L13)

### "./observability.js" (namespace export)

Re-exports all named exports from the "./observability.js" module.

**Signature**

```ts
export * from "./observability.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/index.ts#L11)

### "./runtime-contract.types.js" (namespace export)

Re-exports all named exports from the "./runtime-contract.types.js" module.

**Signature**

```ts
export * from "./runtime-contract.types.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/index.ts#L14)

### "./runtime-events.js" (namespace export)

Re-exports all named exports from the "./runtime-events.js" module.

**Signature**

```ts
export * from "./runtime-events.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/index.ts#L10)

### "./state-control-requests.types.js" (namespace export)

Re-exports all named exports from the "./state-control-requests.types.js" module.

**Signature**

```ts
export * from "./state-control-requests.types.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/index.ts#L15)

### "./state-provider.types.js" (namespace export)

Re-exports all named exports from the "./state-provider.types.js" module.

**Signature**

```ts
export * from "./state-provider.types.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/index.ts#L16)

### "./state-receipts.types.js" (namespace export)

Re-exports all named exports from the "./state-receipts.types.js" module.

**Signature**

```ts
export * from "./state-receipts.types.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/index.ts#L17)

### "./state-thread-requests.types.js" (namespace export)

Re-exports all named exports from the "./state-thread-requests.types.js" module.

**Signature**

```ts
export * from "./state-thread-requests.types.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/index.ts#L18)

### "./state.types.js" (namespace export)

Re-exports all named exports from the "./state.types.js" module.

**Signature**

```ts
export * from "./state.types.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/index.ts#L19)

### "./thread-transition.js" (namespace export)

Re-exports all named exports from the "./thread-transition.js" module.

**Signature**

```ts
export * from "./thread-transition.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/index.ts#L20)

## `model-selection-core.ts`

### normalizeModelSelectorValue

Canonicalizes a selector after validating its syntax.

**Throws**

ModelSelectionError for malformed selectors.

**Example**

```ts
normalizeModelSelectorValue("openai:gpt");
```

**Signature**

```ts
declare const normalizeModelSelectorValue: (value: unknown) => string | undefined;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/model-selection-core.ts#L14)

### parseModelProviderConfigurationValue

Validates and freezes provider defaults.

**Throws**

ModelSelectionError for missing or malformed settings.

**Example**

```ts
parseModelProviderConfigurationValue(config);
```

**Signature**

```ts
declare const parseModelProviderConfigurationValue: (value: unknown) => ModelProviderConfiguration;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/model-selection-core.ts#L36)

### resolveModelSelectorValue

Selects a provider and model from validated configuration.

**Throws**

ModelSelectionError when a provider or model is unavailable.

**Example**

```ts
resolveModelSelectorValue("openai", config);
```

**Signature**

```ts
declare const resolveModelSelectorValue: (
  selector: unknown,
  configuration: ModelProviderConfiguration,
) => ResolvedModelSelection;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/model-selection-core.ts#L77)

## `model-selection-error.ts`

### ModelSelectionEffectError (class)

Recoverable Effect failure for invalid model selection.

**Signature**

```ts
declare class ModelSelectionEffectError
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/model-selection-error.ts#L19)

### ModelSelectionError (class)

Compatible synchronous error for invalid model selection.

**Example**

```ts
throw new ModelSelectionError("RELKIT_MODEL_SELECTOR_INVALID", "Invalid selector");
```

**Signature**

```ts
declare class ModelSelectionError { constructor(
    readonly code: ModelSelectionErrorCode,
    message: string,
  ) }
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/model-selection-error.ts#L7)

### name (property)

**Signature**

```ts
readonly name: "ModelSelectionError"
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/model-selection-error.ts#L8)

### modelSelectionEffectError

Captures a selector error for Effect recovery and public compatibility.

**Example**

```ts
modelSelectionEffectError(new ModelSelectionError("RELKIT_MODEL_SELECTOR_INVALID", "Invalid"));
```

**Signature**

```ts
declare const modelSelectionEffectError: (cause: unknown) => ModelSelectionEffectError;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/model-selection-error.ts#L29)

## `model-selection.ts`

### "./model-selection.types.js" (namespace export)

Re-exports all named exports from the "./model-selection.types.js" module.

**Signature**

```ts
export * from "./model-selection.types.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/model-selection.ts#L18)

### ModelSelectionEffectError

**Signature**

```ts
declare const ModelSelectionEffectError: typeof ModelSelectionEffectError;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/model-selection.ts#L17)

### ModelSelectionError

**Signature**

```ts
declare const ModelSelectionError: typeof ModelSelectionError;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/model-selection.ts#L17)

### normalizeModelSelector

Normalizes an optional provider or provider:model selector.

**Throws**

ModelSelectionError for an invalid selector.

**Example**

```ts
normalizeModelSelector("openai:gpt");
```

**Signature**

```ts
declare const normalizeModelSelector: (value: unknown) => string | undefined;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/model-selection.ts#L37)

### normalizeModelSelectorEffect

Normalizes an optional provider or provider:model selector.

**Example**

```ts
Effect.runSync(normalizeModelSelectorEffect("openai:gpt"));
```

**Signature**

```ts
declare const normalizeModelSelectorEffect: (
  value: unknown,
) => Effect.Effect<string | undefined, ModelSelectionEffectError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/model-selection.ts#L25)

### parseModelProviderConfiguration

Parses and validates configured model providers.

**Throws**

ModelSelectionError for missing or invalid settings.

**Example**

```ts
parseModelProviderConfiguration(config);
```

**Signature**

```ts
declare const parseModelProviderConfiguration: (value: unknown) => ModelProviderConfiguration;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/model-selection.ts#L61)

### parseModelProviderConfigurationEffect

Parses and validates configured model providers.

**Example**

```ts
Effect.runSync(parseModelProviderConfigurationEffect(config));
```

**Signature**

```ts
declare const parseModelProviderConfigurationEffect: (
  value: unknown,
) => Effect.Effect<ModelProviderConfiguration, ModelSelectionEffectError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/model-selection.ts#L46)

### resolveModelSelector

Resolves a selector against provider defaults.

**Throws**

ModelSelectionError for missing providers or defaults.

**Example**

```ts
resolveModelSelector("openai", config);
```

**Signature**

```ts
declare const resolveModelSelector: (
  selector: unknown,
  configuration: ModelProviderConfiguration,
) => ResolvedModelSelection;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/model-selection.ts#L87)

### resolveModelSelectorEffect

Resolves a selector against provider defaults.

**Example**

```ts
Effect.runSync(resolveModelSelectorEffect("openai", config));
```

**Signature**

```ts
declare const resolveModelSelectorEffect: (
  selector: unknown,
  configuration: ModelProviderConfiguration,
) => Effect.Effect<ResolvedModelSelection, ModelSelectionEffectError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/model-selection.ts#L71)

## `model-selection.types.ts`

Stable error codes for model selector and provider configuration failures.

### ModelProviderConfiguration (interface)

Normalized provider defaults used to resolve a model selector.

**Signature**

```ts
export interface ModelProviderConfiguration {
  readonly defaultProvider: string;
  readonly defaultModel: string;
  readonly providers: Readonly<Record<string, { readonly defaultModel?: string }>>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/model-selection.types.ts#L9)

### ModelSelectionErrorCode (type alias)

Stable error codes for model selector and provider configuration failures.

**Signature**

```ts
type ModelSelectionErrorCode =
  | "RELKIT_MODEL_PROVIDER_CONFIGURATION_INVALID"
  | "RELKIT_MODEL_SELECTOR_INVALID"
  | "RELKIT_MODEL_PROVIDER_UNKNOWN"
  | "RELKIT_MODEL_PROVIDER_DEFAULT_MISSING";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/model-selection.types.ts#L2)

### ResolvedModelSelection (interface)

Selected provider, model, and combined stable identifier.

**Signature**

```ts
export interface ResolvedModelSelection {
  readonly provider: string;
  readonly model: string;
  readonly id: string;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/model-selection.types.ts#L16)

## `observability.ts`

### "./observability.types.js" (namespace export)

Re-exports all named exports from the "./observability.types.js" module.

**Signature**

```ts
export * from "./observability.types.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/observability.ts#L15)

### AGENT_OBSERVABILITY_PROTOCOL

**Signature**

```ts
declare const AGENT_OBSERVABILITY_PROTOCOL: "relkit.observability.hooks";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/observability.ts#L17)

### AGENT_OBSERVABILITY_VERSION

**Signature**

```ts
declare const AGENT_OBSERVABILITY_VERSION: 1;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/observability.ts#L18)

### AgentCapturePolicy

**Signature**

```ts
declare const AgentCapturePolicy: AgentCapturePolicy;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/observability.ts#L14)

### AgentCapturePolicyError

**Signature**

```ts
declare const AgentCapturePolicyError: typeof AgentCapturePolicyError;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/observability.ts#L12)

### AgentCaptureRecord

**Signature**

```ts
declare const AgentCaptureRecord: AgentCaptureRecord;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/observability.ts#L14)

### AgentSpanCapture

**Signature**

```ts
declare const AgentSpanCapture: AgentSpanCapture;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/observability.ts#L14)

### captureAgentContent

**Signature**

```ts
declare const captureAgentContent: (
  value: unknown,
  policy: AgentCapturePolicy,
) => AgentCaptureRecord | undefined;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/observability.ts#L6)

### captureAgentContentEffect

**Signature**

```ts
declare const captureAgentContentEffect: (
  value: unknown,
  policy: AgentCapturePolicy,
) => Effect.Effect<AgentCaptureRecord | undefined, never, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/observability.ts#L7)

### createAgentCapturePolicy

**Signature**

```ts
declare const createAgentCapturePolicy: (
  value: AgentCapturePolicy | undefined,
) => AgentCapturePolicy;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/observability.ts#L8)

### createAgentCapturePolicyEffect

**Signature**

```ts
declare const createAgentCapturePolicyEffect: (
  value: AgentCapturePolicy | undefined,
) => Effect.Effect<AgentCapturePolicy, AgentCapturePolicyError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/observability.ts#L9)

### createAgentSpanCapture

**Signature**

```ts
declare const createAgentSpanCapture: (
  input: AgentCaptureRecord | undefined,
  output: AgentCaptureRecord | undefined,
) => AgentSpanCapture | undefined;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/observability.ts#L10)

### createAgentSpanCaptureEffect

**Signature**

```ts
declare const createAgentSpanCaptureEffect: (
  input: AgentCaptureRecord | undefined,
  output: AgentCaptureRecord | undefined,
) => Effect.Effect<
  Readonly<{ output?: AgentCaptureRecord; input?: AgentCaptureRecord }> | undefined,
  never,
  never
>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/observability.ts#L11)

### emitAgentEdge

Emits an observed relationship for existing synchronous tracing callers.

**Example**

```ts
emitAgentEdge(hooks, { relationship: "uses-tool", from: "agent", to: "tool" });
```

**Signature**

```ts
declare const emitAgentEdge: (
  hooks: AgentRuntimeHooks | undefined,
  edge: AgentObservedEdge,
) => void;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/observability.ts#L53)

### emitAgentEdgeEffect

Best-effort emission of an observed relationship.
The sink is intentionally detached because the caller's synchronous tracing path cannot await it.

**Example**

```ts
Effect.runSync(emitAgentEdgeEffect(hooks, edge));
```

**Signature**

```ts
declare const emitAgentEdgeEffect: (
  hooks: AgentRuntimeHooks | undefined,
  edge: AgentObservedEdge,
) => Effect.Effect<void, never, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/observability.ts#L27)

## `observability.types.ts`

### AgentEdgeRelationship (type alias)

Relationships reported by an agent's runtime hooks.

**Example**

```ts
const relationship: AgentEdgeRelationship = "uses-tool";
```

**Signature**

```ts
type AgentEdgeRelationship =
  | "targets-function"
  | "calls-function"
  | "enqueues-job"
  | "publishes-event"
  | "listens-to-event"
  | "uses-bucket"
  | "uses-cache"
  | "invokes-agent"
  | "exposes-as-tool"
  | "uses-tool"
  | "uses-provider-profile";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/observability.types.ts#L7)

### AgentObservabilitySink (interface)

Optional external sink for observed agent relationships.

**Example**

```ts
const sink: AgentObservabilitySink = { emit: (event) => send(event) };
```

**Signature**

```ts
export interface AgentObservabilitySink {
  /** Accepts a public relationship event.
   * @param event - Versioned observed edge.
   * @returns Completion of best-effort sink delivery.
   * @example sink.emit({ protocol: "relkit.observability.hooks", version: 1, type: "edge.observed", edge });
   */
  readonly emit: (event: {
    readonly protocol: typeof AGENT_OBSERVABILITY_PROTOCOL;
    readonly version: typeof AGENT_OBSERVABILITY_VERSION;
    readonly type: "edge.observed";
    readonly edge: AgentObservedEdge;
  }) => MaybePromise<void>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/observability.types.ts#L32)

### AgentObservedEdge (interface)

Directed relationship between two stable descriptors.

**Example**

```ts
const edge: AgentObservedEdge = { relationship: "uses-tool", from: "agent", to: "tool" };
```

**Signature**

```ts
export interface AgentObservedEdge {
  readonly relationship: AgentEdgeRelationship;
  readonly from: string;
  readonly to: string;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/observability.types.ts#L23)

### AgentRuntimeHooks (interface)

Optional synchronous and asynchronous relationship observers.

**Example**

```ts
const hooks: AgentRuntimeHooks = { onObservedEdge: console.log };
```

**Signature**

```ts
export interface AgentRuntimeHooks {
  /** Receives one immutable edge synchronously.
   * @param edge - Observed relationship.
   * @returns Nothing.
   * @example hooks.onObservedEdge?.(edge);
   */
  readonly onObservedEdge?: (edge: AgentObservedEdge) => void;
  readonly observability?: AgentObservabilitySink;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/observability.types.ts#L49)

## `runtime-contract.types.ts`

Carries SDK-independent conversation, approval and content callbacks between
native execution and transports; callbacks retain the caller's signal ownership.

### AgentApprovalHandler (type alias)

Resolves a pending tool approval for an invocation.

**Signature**

```ts
type AgentApprovalHandler = (
  approval: import("./approval.js").PendingApproval,
) => MaybePromise<ApprovalDecision>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/runtime-contract.types.ts#L11)

### AgentContentSink (interface)

Sends agent output and events to the surrounding runtime.

**Signature**

```ts
export interface AgentContentSink {
  readonly emitOutput: (value: unknown, signal: AbortSignal) => MaybePromise<void>;
  readonly finishOutput?: (signal: AbortSignal) => MaybePromise<void>;
  readonly progressSinkForTool?: (tool: {
    readonly toolCallId: string;
    readonly toolId: string;
  }) => import("@relkit/invocation").ProgressSink;
  readonly emitTool?: (
    value: {
      readonly toolCallId: string;
      readonly toolId: string;
      readonly state: import("./state.types.js").ToolPartState;
      readonly value?: unknown;
    },
    signal: AbortSignal,
  ) => MaybePromise<void>;
  readonly emitEvent?: (
    value: import("./runtime-events.js").AgentExecutionEvent,
    signal: AbortSignal,
  ) => MaybePromise<void>;
  readonly emitMessage?: (
    value: import("@relkit/contracts").BrowserMessage,
    signal: AbortSignal,
  ) => MaybePromise<void>;
  readonly emitWaiting?: (
    value: Omit<import("./state.types.js").AgentWaitingState, "revision" | "runId">,
    signal: AbortSignal,
  ) => MaybePromise<void>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/runtime-contract.types.ts#L27)

### AgentConversationMessage (interface)

One user or assistant message in a native agent conversation.

**Signature**

```ts
export interface AgentConversationMessage {
  readonly role: "user" | "assistant";
  readonly content: string;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/runtime-contract.types.ts#L21)

### AgentSteeringSource (interface)

Supplies queued steering messages to a running agent.

**Signature**

```ts
export interface AgentSteeringSource {
  readonly drain: () => MaybePromise<readonly string[]>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/runtime-contract.types.ts#L16)

## `runtime-events.ts`

### AgentExecutionEvent

**Signature**

```ts
declare const AgentExecutionEvent: AgentExecutionEvent;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/runtime-events.ts#L1)

### AgentExecutionSnapshot

**Signature**

```ts
declare const AgentExecutionSnapshot: AgentExecutionSnapshot;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/runtime-events.ts#L1)

## `state-control-requests.types.ts`

Shared state contracts live below execution and provider implementations.

### AcceptControlRequest

**Signature**

```ts
declare const AcceptControlRequest: AcceptControlRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-control-requests.types.ts#L4)

### AdmitContinuationRequest

**Signature**

```ts
declare const AdmitContinuationRequest: AdmitContinuationRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-control-requests.types.ts#L15)

### ClaimControlRequest

**Signature**

```ts
declare const ClaimControlRequest: ClaimControlRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-control-requests.types.ts#L9)

### ContinuationIdentity

**Signature**

```ts
declare const ContinuationIdentity: ContinuationIdentity;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-control-requests.types.ts#L14)

### ControlLimits

**Signature**

```ts
declare const ControlLimits: ControlLimits;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-control-requests.types.ts#L3)

### ControlPage

**Signature**

```ts
declare const ControlPage: ControlPage;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-control-requests.types.ts#L7)

### LookupContinuationReceiptRequest

**Signature**

```ts
declare const LookupContinuationReceiptRequest: LookupContinuationReceiptRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-control-requests.types.ts#L16)

### LookupControlReceiptRequest

**Signature**

```ts
declare const LookupControlReceiptRequest: LookupControlReceiptRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-control-requests.types.ts#L5)

### MarkControlEffectStartedRequest

**Signature**

```ts
declare const MarkControlEffectStartedRequest: MarkControlEffectStartedRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-control-requests.types.ts#L11)

### ReadControlsRequest

**Signature**

```ts
declare const ReadControlsRequest: ReadControlsRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-control-requests.types.ts#L6)

### RecoverAbandonedControlRequest

**Signature**

```ts
declare const RecoverAbandonedControlRequest: RecoverAbandonedControlRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-control-requests.types.ts#L13)

### RenewControlClaimRequest

**Signature**

```ts
declare const RenewControlClaimRequest: RenewControlClaimRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-control-requests.types.ts#L10)

### SettleControlRequest

**Signature**

```ts
declare const SettleControlRequest: SettleControlRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-control-requests.types.ts#L12)

### WaitForControlsRequest

**Signature**

```ts
declare const WaitForControlsRequest: WaitForControlsRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-control-requests.types.ts#L8)

## `state-provider.types.ts`

Shared state contracts live below execution and provider implementations.

### AgentStateProvider

**Signature**

```ts
declare const AgentStateProvider: AgentStateProvider;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-provider.types.ts#L2)

## `state-receipts.types.ts`

Shared state contracts live below execution and provider implementations.

### AcceptRunReceipt

**Signature**

```ts
declare const AcceptRunReceipt: AcceptRunReceipt;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-receipts.types.ts#L4)

### CompletionReceipt

**Signature**

```ts
declare const CompletionReceipt: CompletionReceipt;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-receipts.types.ts#L6)

### ContinuationReceipt

**Signature**

```ts
declare const ContinuationReceipt: ContinuationReceipt;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-receipts.types.ts#L10)

### ContinuationReceiptLookup

**Signature**

```ts
declare const ContinuationReceiptLookup: ContinuationReceiptLookup;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-receipts.types.ts#L13)

### ControlReceipt

**Signature**

```ts
declare const ControlReceipt: ControlReceipt;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-receipts.types.ts#L9)

### ControlReceiptLookup

**Signature**

```ts
declare const ControlReceiptLookup: ControlReceiptLookup;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-receipts.types.ts#L12)

### CreateThreadReceipt

**Signature**

```ts
declare const CreateThreadReceipt: CreateThreadReceipt;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-receipts.types.ts#L3)

### InterruptionReceipt

**Signature**

```ts
declare const InterruptionReceipt: InterruptionReceipt;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-receipts.types.ts#L7)

### JournalReceipt

**Signature**

```ts
declare const JournalReceipt: JournalReceipt;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-receipts.types.ts#L5)

### RunReceiptLookup

**Signature**

```ts
declare const RunReceiptLookup: RunReceiptLookup;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-receipts.types.ts#L11)

### SuspensionReceipt

**Signature**

```ts
declare const SuspensionReceipt: SuspensionReceipt;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-receipts.types.ts#L8)

## `state-thread-requests.types.ts`

Shared state contracts live below execution and provider implementations.

### AcceptRunRequest

**Signature**

```ts
declare const AcceptRunRequest: AcceptRunRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-thread-requests.types.ts#L10)

### AgentStateLimits

**Signature**

```ts
declare const AgentStateLimits: AgentStateLimits;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-thread-requests.types.ts#L3)

### AppendJournalRequest

**Signature**

```ts
declare const AppendJournalRequest: AppendJournalRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-thread-requests.types.ts#L17)

### ClaimRunRequest

**Signature**

```ts
declare const ClaimRunRequest: ClaimRunRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-thread-requests.types.ts#L15)

### CompleteRunRequest

**Signature**

```ts
declare const CompleteRunRequest: CompleteRunRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-thread-requests.types.ts#L18)

### CreateThreadRequest

**Signature**

```ts
declare const CreateThreadRequest: CreateThreadRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-thread-requests.types.ts#L4)

### InterruptOwnedRunRequest

**Signature**

```ts
declare const InterruptOwnedRunRequest: InterruptOwnedRunRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-thread-requests.types.ts#L20)

### JournalPage

**Signature**

```ts
declare const JournalPage: JournalPage;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-thread-requests.types.ts#L13)

### ListThreadsRequest

**Signature**

```ts
declare const ListThreadsRequest: ListThreadsRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-thread-requests.types.ts#L6)

### LoadThreadRequest

**Signature**

```ts
declare const LoadThreadRequest: LoadThreadRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-thread-requests.types.ts#L5)

### LookupRunReceiptRequest

**Signature**

```ts
declare const LookupRunReceiptRequest: LookupRunReceiptRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-thread-requests.types.ts#L11)

### ReadJournalRequest

**Signature**

```ts
declare const ReadJournalRequest: ReadJournalRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-thread-requests.types.ts#L12)

### ReadSnapshotHistoryRequest

**Signature**

```ts
declare const ReadSnapshotHistoryRequest: ReadSnapshotHistoryRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-thread-requests.types.ts#L8)

### RenewRunClaimRequest

**Signature**

```ts
declare const RenewRunClaimRequest: RenewRunClaimRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-thread-requests.types.ts#L16)

### SnapshotHistoryPage

**Signature**

```ts
declare const SnapshotHistoryPage: SnapshotHistoryPage;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-thread-requests.types.ts#L9)

### SuspendRunRequest

**Signature**

```ts
declare const SuspendRunRequest: SuspendRunRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-thread-requests.types.ts#L19)

### ThreadList

**Signature**

```ts
declare const ThreadList: ThreadList;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-thread-requests.types.ts#L7)

### WaitForJournalRequest

**Signature**

```ts
declare const WaitForJournalRequest: WaitForJournalRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state-thread-requests.types.ts#L14)

## `state.types.ts`

### AgentObservation

**Signature**

```ts
declare const AgentObservation: AgentObservation;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L2)

### AgentProgressScope

**Signature**

```ts
declare const AgentProgressScope: AgentProgressScope;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L3)

### AgentRequestScope

**Signature**

```ts
declare const AgentRequestScope: AgentRequestScope;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L4)

### AgentWaitingRequest

**Signature**

```ts
declare const AgentWaitingRequest: AgentWaitingRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L5)

### AgentWaitingState

**Signature**

```ts
declare const AgentWaitingState: AgentWaitingState;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L6)

### BrowserMessage

**Signature**

```ts
declare const BrowserMessage: BrowserMessage;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L7)

### BrowserMessagePart

**Signature**

```ts
declare const BrowserMessagePart: BrowserMessagePart;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L8)

### ControlClaim

**Signature**

```ts
declare const ControlClaim: ControlClaim;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L9)

### ControlEffectOutcome

**Signature**

```ts
declare const ControlEffectOutcome: ControlEffectOutcome;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L10)

### ControlRecord

**Signature**

```ts
declare const ControlRecord: ControlRecord;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L11)

### ControlStatus

**Signature**

```ts
declare const ControlStatus: ControlStatus;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L12)

### ExecutionClaim

**Signature**

```ts
declare const ExecutionClaim: ExecutionClaim;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L13)

### JournalCheckpoint

**Signature**

```ts
declare const JournalCheckpoint: JournalCheckpoint;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L14)

### JournalRecord

**Signature**

```ts
declare const JournalRecord: JournalRecord;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L15)

### RunOwner

**Signature**

```ts
declare const RunOwner: RunOwner;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L16)

### RunStatus

**Signature**

```ts
declare const RunStatus: RunStatus;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L17)

### StoredApproval

**Signature**

```ts
declare const StoredApproval: StoredApproval;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L18)

### StoredRun

**Signature**

```ts
declare const StoredRun: StoredRun;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L19)

### StoredRunRouting

**Signature**

```ts
declare const StoredRunRouting: StoredRunRouting;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L20)

### StoredThread

**Signature**

```ts
declare const StoredThread: StoredThread;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L21)

### ThreadListItem

**Signature**

```ts
declare const ThreadListItem: ThreadListItem;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L22)

### ThreadSnapshot

**Signature**

```ts
declare const ThreadSnapshot: ThreadSnapshot;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L23)

### ThreadStatus

**Signature**

```ts
declare const ThreadStatus: ThreadStatus;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L24)

### ToolPartState

**Signature**

```ts
declare const ToolPartState: ToolPartState;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/state.types.ts#L25)

## `thread-transition.ts`

Exposes the shared durable thread transition table through the existing agent
telemetry boundary; provider implementations call the lower contracts owner.

### AgentTransitionError

**Signature**

```ts
declare const AgentTransitionError: AgentTransitionError;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/thread-transition.ts#L10)

### ThreadAction

**Signature**

```ts
declare const ThreadAction: ThreadAction;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/thread-transition.ts#L10)

### ThreadTransition

**Signature**

```ts
declare const ThreadTransition: ThreadTransition;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/thread-transition.ts#L10)

### decideThreadTransition

Decides a thread action for synchronous framework callers.

**Signature**

```ts
declare const decideThreadTransition: (
  status: ThreadStatus,
  action: ThreadAction,
) => ThreadTransition;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/thread-transition.ts#L26)

### decideThreadTransitionEffect

Observes a shared thread decision without duplicating its state machine.

**Signature**

```ts
declare const decideThreadTransitionEffect: (
  status: ThreadStatus,
  action: ThreadAction,
) => Effect.Effect<ThreadTransition, never, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/thread-transition.ts#L17)

## `thread-transition.types.ts`

Shared state contracts live below execution and provider implementations.

### AgentTransitionError

**Signature**

```ts
declare const AgentTransitionError: AgentTransitionError;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/thread-transition.types.ts#L2)

### ThreadAction

**Signature**

```ts
declare const ThreadAction: ThreadAction;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/thread-transition.types.ts#L2)

### ThreadTransition

**Signature**

```ts
declare const ThreadTransition: ThreadTransition;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/agents/src/thread-transition.types.ts#L2)
