Skip to main content

@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​

Variables​

Functions​