@timon-ai/sdk/provider
@timon-ai/sdk/provider — what a provider author writes an LLM provider
AGAINST: the contract's types, its constants, and the few guards that decide
nothing by themselves.
The BEHAVIOUR is not here. Codecs, the usage-limit detector, the session
drivers, the MCP serializers and the ACP client come from the daemon, through
ctx.provider.runtime (API 12): one copy, the daemon's, so a fix reaches every
installed plugin without its author publishing again. Your dialect is built from
ctx.provider.runtime (its events, jsonLines, limits…), usually by a factory
the plugin's apply calls (createMyDialect(ctx.provider.runtime)), so that your
tests can hand it the same object — @timon-ai/sdk/testing builds a stand-in ctx that carries a
copy of the daemon's runtime for tests run outside the daemon.
This entry point is built to run outside the repository: every module it
reaches is free of the daemon (no database, no host adapter, no settings),
which a test in the repository enforces. Because nothing here holds state or
behaviour, nothing depends on identity: errors are recognised by code,
drivers by brand (isLineSessionDriver), never by instanceof.
Declare apiVersion: 12 in the plugin manifest to use ctx.provider: from that
version the daemon also refuses, at registration, a dialect whose declarations
contradict each other (runtime.check.dialectProblems tells you the same thing
before you ship).
Interfaces
Type Aliases
- AccountUsage
- AcpAgentSpec
- AcpMcpServer
- AcpProviderServices
- AcpRecord
- AcpSignIn
- AcpUsage
- AnyDialect
- ApprovalScope
- AssistantDeltaPayload
- BackendCapabilities
- BackendCapability
- BackendLaunchContext
- BackendName
- BackendProfile
- BuildSpawnOpts
- CatalogModel
- DeclaredReasoningControl
- DiscoveredModel
- EnvResolver
- EnvValue
- ImageAttachment
- InstallPlatform
- LaunchStrategy
- LegacyLaunch
- LifecycleStrategy
- LimitsStrategy
- LinesCodec
- LineSessionOptions
- LineSplitterOptions
- LocalEnvPolicy
- McpLaunchHttp
- McpLaunchServer
- McpLaunchStdio
- McpStrategy
- ModelReasoning
- ModelsStrategy
- ModelTier
- NativeProviderDefinition
- NormalizedEvent
- OpenSpan
- PackageManagerName
- PermissionDecision
- PermissionModel
- PermissionRequest
- PermissionStrategy
- ProcessDriverCodec
- ProcessProviderDefinition
- ProcessSessionArgs
- ProfileRuntime
- ProviderAccount
- ProviderAccountContext
- ProviderAccountsDeclaration
- ProviderAgentConfig
- ProviderAuthStatus
- ProviderBinary
- ProviderBinaryDeclaration
- ProviderBrand
- ProviderConfig
- ProviderConversation
- ProviderConverseOptions
- ProviderCredentialStore
- ProviderDeclarations
- ProviderDefinition
- ProviderDesktopBuild
- ProviderEnvPlan
- ProviderGeneratedMedia
- ProviderGit
- ProviderInstallPlan
- ProviderLoginDriver
- ProviderLoginIdentity
- ProviderLoginPrompt
- ProviderLoginRun
- ProviderMcpOptions
- ProviderMcpPlan
- ProviderMcpRole
- ProviderMcpServer
- ProviderMedia
- ProviderOsCredentials
- ProviderPluginContext
- ProviderProbeOptions
- ProviderProbeResult
- ProviderRedact
- ProviderRuntime
- ProviderScratch
- ProviderScratchDir
- ProviderServeOptions
- ProviderServer
- ProviderServiceNeed
- ProviderServices
- ProviderSettingValue
- ProviderTransportKind
- RateLimitHit
- RateLimitReporting
- ReasoningControl
- ReasoningStrategy
- RefreshedToken
- RegisteredProfile
- RemoteDialect
- RemoteDriverCodec
- RemoteProviderDefinition
- RemoteResumeState
- RemoteSessionHost
- RemoteSessionOpenArgs
- RemoteSessionResume
- RpcId
- RpcMessage
- ScratchLinkMethod
- ScratchWriteOptions
- SecretRef
- SessionCapabilities
- SessionEnd
- SessionHost
- SessionInfo
- SessionOpenArgs
- SessionStdio
- SessionStore
- SessionStrategy
- SpanKind
- SpanOp
- SpanState
- SpanStatus
- SpawnResult
- TemplateContext
- TokenUsage
- TurnOutcome
- UsageStrategy
- UsageWindow
Variables
- APPROVAL_SCOPES
- ASK_MCP_FORMS_ONLY_ENV
- ASK_MCP_SERVER
- ASK_TOOL_KANBAN_PLAN
- ASK_TOOL_QUESTION
- ASK_TOOL_REQUEST
- ASSISTANT_DELTA
- BACKEND_CAPABILITIES
- CLAUDE_PERMISSION_PROMPT_TOOL
- DEFAULT_BACKEND_CAPABILITIES
- DEFAULT_MAX_LINE_CHARS
- INSTALL_PLATFORMS
- LINE_SESSION_DRIVER
- MAX_BRAND_SVG_BYTES
- MODEL_TIERS
- NO_SESSION_CAPABILITIES
- PACKAGE_MANAGERS
- PERMISSION_MODEL_OBLIGATIONS
- PERMISSION_MODELS
- PROVIDER_TRANSPORTS
- RATE_LIMIT_REPORTINGS
- REMOTE_RESUME_MAX_BYTES
- RPC_INTERNAL_ERROR
- RPC_INVALID_PARAMS
- RPC_METHOD_NOT_FOUND
- SERVICE_NEEDS
- SESSION_STORES
- SPAN_KINDS
- SPAN_STATUSES
- USAGE_NOT_SIGNED_IN