API reference
API reference
Every public symbol in @theokit/sdk, auto-generated from TypeDoc.
API reference
This section is auto-generated from TypeDoc on every build. 249 symbols exported.
Classes
Agent— Static façade for creating and managing Theo agents.AgentBuilder— Fluent builder for AgentOptions. Chainable setters mutate internalAgentRunError— Thrown byAgent.prompt(and helpers that go throughrun.wait()) whenAuthenticationError— Invalid API key, not logged in, insufficient permissions.Cache— no descriptionCacheEmbedderError— no descriptionCacheInvalidTtlError— no descriptionConfigurationError— Invalid model, bad request parameters, malformed options.CredentialPoolExhaustedError— Thrown when every credential in a per-provider pool is in cooldownCron— Static façade for scheduling Theo agent runs on a cron expression.Eval— no descriptionEvalAlreadyRunningError— no descriptionGenerateObjectError— Typed error thrown by Agent.generateObject when the model refusesHandoff— no descriptionHandoffLoopError— Throw when handoff depth exceedsmaxHandoffDepth(default 5; D218).HandoffNameCollisionError— Throw when two handoffs in the same parent collide on tool name (D215).HandoffPairLoopError— Throw when the same (sender, receiver) pair invoked twice in one send() (D221).HandoffReceiverDisposedError— Throw when receiver is disposed at dispatch time (EC-5).HandoffSelfReferenceError— Throw when an agent'shandoffs[]includes a self-reference (EC-6).IntegrationNotConnectedError— Thrown when creating a cloud agent for a repo whose SCM provider is notMemoryAdapterError— Error raised by@theokit-memory-*adapters. CarriesadapterIdNetworkError— Service unavailable, timeout, transport-level failure.RateLimitError— Too many requests or usage limits exceeded.Security— no descriptionStreamObjectError— Error thrown by Agent.streamObject when the model refuses to callTheokit— Account-level and catalog reads. All methods accept an optionalapiKeyTheokitAgentError— Base class for all errors thrown by@theokit/sdk.UnknownAgentError— Catch-all for unclassified server or runtime errors.UnsupportedRunOperationError— Thrown when a Run or agent operation is not available on the currentWorkflow— no descriptionWorkflowAlreadyRunningError— no descriptionWorkflowBuilder— no descriptionWorkflowCompensateNotImplementedError— D238 — saga engine not yet implemented.WorkflowDuplicateStepIdError— no descriptionWorkflowMaxIterationsExceededError— no descriptionWorkflowNotSerializableError— EC-4 absorbed — JSON.stringify failed on snapshot payload.WorkflowParallelError— Aggregate failure from parallel branches.WorkflowResumeStepNotFoundError— EC-8 absorbed —currentStepIdfrom snapshot not found in resumed workflow.WorkflowSnapshotNotFoundError— no description
Constantes
Memory— no descriptionRECOMMENDED_HANDOFF_PROMPT_PREFIX— Recommended system-prompt prefix for senders (D215 / EC-13).Scorers— no description
Functiones
agentStep— no descriptioncreateAgentFactory— no descriptiondefinePlugin— no descriptiondefineTool— no descriptionextractRawId— no descriptionfn— no descriptionhandoffTo— no descriptionmigrateSqliteToLance— no descriptionmkMemoryId— no descriptiontoShareGptTrajectory— no description
Interfacees
AgentConversationTurn— Agent turn: user message + assistant/tool/thinking steps.AgentDefinition— Subagent definition. The parent agent spawns these via its Agent tool.AgentFactory— Handle returned by createAgentFactory. See ADR D23 for mergeAgentMemory— Direct memory API exposed onSDKAgent.memory. Resolves to whicheverAgentOperationOptions— Options for archive/unarchive/delete.AgentOptions— Top-level options accepted byAgent.create().AgentStep— An agent.send-driven step.AssistantMessage— Plain assistant message in a conversation history.BatchItem— Single prompt in a batch. Plain string is shorthand for{ prompt }.BatchOptions— Options accepted byAgent.batch. ExtendsAgentOptions— everyBatchProgress— Live progress snapshot delivered toonProgress.BranchStep— First-match-wins predicates + optional fallback.CacheEmbedderRuntime— Embedder runtime shape — minimal subset ofEmbeddingRuntime(D11) theCacheEntry— no descriptionCachePersistenceOptions— no descriptionCacheSemanticOptions— no descriptionCacheStats— no descriptionCacheTTLConfig— Public type contract forCache.semantic / .asPlugin / .stats / .clearCloudEnv— Cloud execution environment.CloudOptions— Cloud agent configuration.CloudRepo— Repo to clone into a cloud agent's VM.ContextBudget— Token budget used by the context manager for a single agent.ContextSettings— Context configuration accepted byAgent.create()via AgentOptions.context.ContextSnapshot— Result ofagent.context.snapshot(). Public and secret-free by design — safeContextSource— A single context source resolved by the context manager.CronCreateOptions— Options forCron.create().CronGetOptions— Options forCron.get().CronJob— Persistent cron-scheduled invocation of the Theo agent.CronOperationOptions— Options forCron.delete()/Cron.enable()/Cron.disable().CronRunOptions— Options forCron.run()— manually trigger a job off-schedule.CronSchedulerStatus— Snapshot of the local scheduler returned byCron.status().CronStartOptions— Options forCron.start()— activates the in-process scheduler for localCustomTool— Inline custom tool — registered with the LLM under the given name + schemaDatasetEntry— A single dataset row — input prompt + optional reference + free-form metadata.DefineToolSpec— Spec accepted by defineTool.inputSchemais a Zod schema; theDowhileStep— Loop a step until condFn returns false.DreamingSweepOptions— PublicMemorynamespace.DreamingSweepResult— no descriptionErrorMetadata— Structured context for errors that originated from a provider HTTPEvalAggregate— Aggregate stats — the production-decision dashboard data (D211).EvalHooks— Lifecycle hooks. Each fires inside asafeHookwrapper (EC-4); a throw never abEvalOptions— Public options forEval.create.EvalRowResult— Per-row outcome.EvalRun— Final run result — plain serializable JSON (D209).EvalRunOptions— Per-call options foreval.run(...).FnStep— A pure function step.ForeachStep— Map a step over an upstream array output.GenerateObjectOptions— Options accepted by Agent.generateObject. Returns a typed objectGenerateObjectResult— Successful return from Agent.generateObject.GetAgentOptions— Options forAgent.get().GoalOptions— Per-call configuration forAgent.runUntil.GoalResult— Return value of therunUntilasync generator. Consumer reads viaHandoffContext— Context handed toonHandoffcallbacks andisEnabledpredicates.HandoffDescriptor— PublicHandoffshape — whatHandoff.create()returns. Read-onlyHandoffHistory— The transcript wrapper passed toinputFilter.messagesis widened toHandoffOptions— Options accepted byHandoff.create(target, opts?).HandoffResult— Result of a single handoff dispatch (for telemetry / observability).InvalidateCacheOptions— Options for SDKAgent.invalidateCache.ListResult— Paginated list shape.LocalOptions— Local agent configuration.McpAuthConfig— OAuth-style auth bundle for HTTP/SSE MCP servers.McpOAuthConfig— OAuth 2.1 PKCE flow descriptor. See ADR D41.MemoryAdapter— Portable third-party memory adapter contract. Implementations liveMemoryAdapterCapabilities— Statically declared adapter feature flags. Consumers feature-detectMemoryContext— Portable identity context.userIdis the only required field —MemoryFact— A single memory fact returned byrecallorget.MemoryRevision— Versioned snapshot of a memory's history. Only emitted by providersMemorySettings— Memory configuration accepted byAgent.create()via AgentOptions.memory.MemoryToolSchema— OpenAI-format function-calling schema exposed to the LLM.MemoryTurnMessage— One assistant-turn message in the canonical{role, content}shapeMigrateOptions— Options for migrateSqliteToLance.MigrateResult— Outcome of migrateSqliteToLance.ModelListItem— Single model entry in the catalog.ModelParameterDefinition— Per-model parameter definition discovered fromTheokit.models.list().ModelParameterValue— One slot in a ModelSelection.params array.ModelSelection— Identifies a model plus optional per-model parameters (e.g. reasoning effort).ModelVariant— Preset variant for a model — pre-filled parameter combinations.NamedScorer— A named scorer — produced by everyScorers.*factory.ParallelStep— N concurrent branches, each its own mini-step-list.PartialToolCallUpdate— Tool call arguments streaming in incrementally.PerScorerStats— Per-scorer breakdown computed across all rows.PersonalityPreset— Resolved personality preset surfaced via SDKAgent.usePersonalityPluginContext— no descriptionPluginsSettings— Plugins configuration accepted byAgent.create()viaPreToolCallContext— no descriptionPreToolCallDecision— no descriptionProviderProfile— no descriptionProviderRoute— A single user-declared routing rule. Maps a capability to a provider, andProviderRoutingSettings— Provider routing configuration accepted byAgent.create()viaResolvedProviderRoute— Resolved routing decision returned byagent.providers.routes(). Public andRetryPolicy— D237 — retry policy applied per fn/agent step.Run— Handle to a single prompt submission.RunErrorDetail— Structured error attached to a RunResult when the underlying runRunGitInfo— Git metadata attached to cloud runs.RunResult— Terminal result of a Run.Score— Outcome of a single scoring decision.scorein [0, 1]; the runner clamps.SDKAgent— Handle returned byAgent.create()andAgent.resume().SDKAgentPlugins— Public plugin listing handle exposed asagent.plugins. Populated whenSDKAgentSkills— Public skill listing handle exposed asagent.skills. Populated whenSDKArtifact— Artifact produced inside an agent's workspace. Cloud-only.SDKAssistantMessage— Model text output for this run.SDKContextManager— Public context manager handle exposed asagent.context.SDKImageDimension— Dimensions of an inline image attachment.SDKObjectDelta— Partial object emitted duringAgent.streamObject<T>streaming (ADR D45).SDKPluginMetadata— Public plugin metadata returned byagent.plugins.list(). Mirrors theSDKProvider— Provider catalog entry returned byTheokit.providers.list().SDKProvidersManager— Public providers manager handle exposed asagent.providers.SDKRepository— GitHub repository connected to the team. Cloud-only.SDKRequestMessage— Awaiting user input or approval.SDKStatusMessage— Cloud run lifecycle transitions.SDKSystemMessage— Init metadata. Emitted once at the start of a run.SDKTaskMessage— Task-level milestones and summaries.SDKThinkingMessage— Reasoning content.SDKToolUseMessage— Tool invocation lifecycle event. Emitted at start withargs, then again onSDKUser— Account-level user info returned byTheokit.me().SDKUserMessage— Structured form ofagent.send()'s message argument. Use it to send imagesSDKUserMessageEvent— Echo of the user prompt for this run.SendOptions— Per-send overrides and callbacks.ShareGptMessage— One ShareGPT message in a conversation.fromidentifies the role andShareGptTrajectory— One full ShareGPT-format trajectory — a single conversation plusShellCommand— Shell command executed during a run.ShellConversationTurn— Shell turn: a command and its output.ShellOutput— Output of a shell command.ShellOutputDeltaUpdate— no descriptionSkillsSettings— Skills configuration accepted byAgent.create()viaSleepStep— Pause for a fixed duration.StepCompletedUpdate— Conversation step completed.StepContext— D247 — context handed to every step.fn.StepResult— no descriptionStepStartedUpdate— Conversation step started.StreamObjectOptions— Options accepted by Agent.streamObject. Same shape asSummaryCompletedUpdate— no descriptionSummaryStartedUpdate— no descriptionSummaryUpdate— no descriptionSuspendStep— Standalone explicit suspend point.SystemPromptContext— Context passed to a SystemPromptResolver. Field order is aSystemPromptMemoryFact— Public view of a recalled memory fact exposed to the system-prompt resolver.SystemPromptSkillRef— Public skill metadata exposed to the system-prompt resolver. Mirrors theTelemetrySettings— Telemetry configuration for an agent. Whenenabled: true, the SDK emitsTextBlock— Plain text content block emitted by the assistant or user.TextDeltaUpdate— Incremental text token from the assistant.TheokitRequestOptions— Options shared by everyTheokit.*request.ThinkingCompletedUpdate— Emitted when a reasoning block completes.ThinkingDeltaUpdate— Incremental reasoning token.ThinkingMessage— Reasoning step in a conversation history.TokenDeltaUpdate— Token count delta for usage tracking.ToolCall— Single tool call event. The internalargsandresultshapes are NOT stable.ToolCallCompletedUpdate— Tool call completed.ToolCallStartedUpdate— Tool call started — args committed.ToolUseBlock— Tool invocation block emitted by the assistant.TurnEndedUpdate— Turn ended with usage summary.UserMessage— User-authored message in a conversation history.UserMessageAppendedUpdate— User message appended to the conversation.WorkflowOptions— no descriptionWorkflowPersistenceOptions— no descriptionWorkflowResumeOptions— no descriptionWorkflowRun— no descriptionWorkflowRunOptions— no descriptionWorkflowSnapshot— no description
Typees
AgentPromptResult— Result of a one-shot Agent.prompt call.BatchResult— Per-prompt outcome. Discriminated union — checkokbefore readingContextManagerKind— Context manager backend.ContextSourceStatus— Inclusion state of a single context source in a ContextSnapshot.ConversationStep— Single step inside an agent turn.ConversationTurn— Structured per-turn view of a run.CronJobStatus— Lifecycle state reported byCron.list()/Cron.get().CronListOptions— Options forCron.list().CronRuntime— Runtime hosting a cron job. Mirrors the agent runtime split.Dataset—Datasetis either an array OR a factory returning a (sync or async)DeepPartial— Recursive partial —Twhere every nested field becomes optional.ErrorCode— Finite, machine-readable error codes for provider-originated errorsEvalAgentOptions— InferredAgent.createoptions shape — avoid cycling throughAgentOptionsdirGetRunOptions— Options forAgent.getRun(). Cloud requires the parentagentId.GoalEvent— Single event emitted while iterating a goal-driven loop. Five variants:HookName— no descriptionInteractionUpdate— Lowest-level raw update from a run. PassonDeltatoagent.send()toListAgentsOptions— Options forAgent.list().ListRunsOptions— Options forAgent.listRuns().McpHttpServerConfig— HTTP or SSE MCP server.McpServerConfig— Union of MCP server configs. Seedocs.mdfor the full reference.McpStdioServerConfig— MCP server configuration accepted byAgent.create()andagent.send().MemoryAdapterErrorCode— Finite error codes specific to memory adapter operations (ADR D141).MemoryId— Branded provider memory ID. Format:${adapterId}:${rawProviderId}.Plugin— no descriptionProviderCapability— Capability slot a provider can fulfill.RunOperation— Operations that may or may not be supported on a given Run, or onRunStatus— Lifecycle status of a Run.RunUntilIterator— Return type of import("../internal/runtime/local-agent.js").LocalAgent.runUntil.Scorer— Scorer signature (D207). ReturnsScoresynchronously OR via Promise —SDKAgentInfo— Metadata returned byAgent.list()andAgent.get().SDKImage— Either a remote URL or inline base64 payload.SDKMessage— Discriminated union of all stream events. Discriminate ontype.SDKModel— no descriptionSettingSource— Which on-disk settings layers a local agent loads.Step— no descriptionStreamObjectEvent— Event emitted by Agent.streamObject. Discriminate ontype.SystemPromptResolver— Resolver function that produces the system prompt dynamically. Receives