Skip to content

Interface: AdapterProviderDefinitionContract

Makaio Framework


Makaio Framework / contracts / AdapterProviderDefinitionContract

Interface: AdapterProviderDefinitionContract

Section titled “Interface: AdapterProviderDefinitionContract”

Defined in: ../../../packages/contracts/src/extension/adapter-definition.ts:60

Runtime contract for a single provider supported by an adapter.

This type is the single source of truth for the provider definition wrapper. Both ai-adapters-core/src/types/provider-definition.ts and adapter-subsystem/src/adapter-runtime-types.ts extend or alias this type.

readonly optional configSchema?: ZodObject<Readonly<{[k: string]: $ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>; }>, $strip>

Defined in: ../../../packages/contracts/src/extension/adapter-definition.ts:77

Zod schema for provider-specific configuration fields.

When present, the adapter subsystem uses this schema to validate and expose provider configuration via the settings bus handlers. Not serializable — kept in the definition, not the manifest.


readonly optional credentialSchema?: ZodObject<Readonly<{[k: string]: $ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>; }>, $strip>

Defined in: ../../../packages/contracts/src/extension/adapter-definition.ts:85

Zod schema for provider credential fields (e.g., API key, token).

When present, the adapter subsystem uses this schema to validate credentials before forwarding them to the adapter factory. Not serializable — kept in the definition, not the manifest.


readonly definition: object

Defined in: ../../../packages/contracts/src/extension/adapter-definition.ts:69

Provider identity, model catalog, and endpoint declarations.

Accepts ProviderDefinitionInput so adapter packages that declare static providerDefinition constants can omit availableModels (which the registry service populates at boot time). The runtime-resolved type narrows after the adapter subsystem merges the registry data.

optional availableModels?: object[]

Runtime-populated model catalog for this provider.

At boot the registry service merges lab definitions with provider-specific overrides and injects the result here. Static provider packages and fixtures should omit this field from ProviderDefinitionInput; the registry service owns the content. Defaults to [] on parsed definitions so runtime callers never need to handle undefined.

optional credentialEnvVars?: Record<string, string>

Environment variable names for credential fields.

Maps credential field names (matching the adapter’s credentialSchema keys) to environment variable names. Used as last-resort fallback when credentials are not provided via saved config or runtime input.

`{ apiKey: 'ANTHROPIC_API_KEY' }` or `{ token: 'COPILOT_TOKEN' }`

optional defaultModel?: string

Default model identifier for general-purpose tasks (e.g., 'claude-sonnet-4-5'). Optional — providers with fully dynamic model discovery may omit this.

optional defaultModelFilterMode?: "allowlist" | "show-all"

Recommended default filter mode applied when a provider record is first created.

  • 'show-all' — all models visible by default (curated providers like Anthropic).
  • 'allowlist' — all models hidden by default (firehose providers like OpenRouter).

Defaults to 'show-all' in the sync service when omitted.

optional description?: string

Short human-readable description of the provider.

optional endpoints?: object

Wire protocol endpoints for this provider.

Maps each supported protocol to a base URL. Omit for SDK-only providers (e.g., GitHub Copilot) that communicate through a proprietary transport.

optional anthropic?: string

optional openai?: string

optional fastModel?: string

Fast/cheap model for cost-sensitive operations (e.g., 'claude-haiku-4-5'). Used for subagent exploration and background processing. Falls back to defaultModel when omitted.

id: string

Stable provider identifier used for persistence and matching (e.g., 'anthropic', 'z-ai').

Acts as the primary key across all provider-related storage and bus messages. Must be unique across all registered provider packages.

name: string

Display name shown in the UI (e.g., 'Anthropic', 'Z.AI').