Skip to content

Interface: AgentSelectionKindMap

Makaio Framework


Makaio Framework / contracts / AgentSelectionKindMap

Defined in: ../../../packages/contracts/src/adapter/schemas/agent-resolution.ts:170

Interface map for the AgentSelection discriminated union.

Framework registers 'adapter' here. Host or application packages widen the union by augmenting this interface via declaration merging:

// In an application package's selection module
declare module '@makaio/contracts' {
interface AgentSelectionKindMap {
persona: PersonaSelection;
}
}

This gives compile-time narrowing (switch(agent.kind)) for all registered kinds while keeping the Zod wire schema open (kind: z.string()).

adapter: object

Defined in: ../../../packages/contracts/src/adapter/schemas/agent-resolution.ts:171

[key: string]: unknown

optional adapterId?: string

Adapter instance UUID for unambiguous multi-host targeting.

In a multi-host bus topology, multiple adapters may share the same adapterName. When provided, adapterId bypasses name-based resolution and targets the specific adapter instance directly.

Resolution with both fields: adapterId takes precedence and adapterName is backfilled from adapter storage when omitted.

optional adapterName?: string

Adapter driver name (e.g., 'anthropic-sdk', 'openai-node').

When adapterId is omitted, this is resolved via the adapter registry to an adapterId. When adapterId is provided, adapterName can be omitted and is backfilled from adapter storage.

When multiple hosts serve the same adapter name, the local adapter is preferred.

optional allowedDirectories?: string[]

Directory restrictions for file-system tool execution.

  • undefined: no restriction (use adapter/runtime defaults)
  • []: deny all filesystem paths
  • non-empty array: restrict access to listed directories

optional allowedTools?: string[]

Allowed tool names (adapter-specific). Empty array = disable all tools.

optional cwd?: string

Working directory for agent execution.

optional disallowedTools?: string[]

Disallowed tool names (adapter-specific). Takes precedence over allowedTools.

kind: "adapter"

optional model?: string

Model identifier (e.g., 'sonnet', 'gpt-4o'). Overrides resolved model.

optional providerConfigId?: string

Provider config UUID — “use these credentials.”

Links to a user-created ProviderConfigRecord with endpoint overrides and credentials. Orthogonal to resolution strategy: resolution produces an adapter + model, this field selects which account/credentials to use for the API call.

When omitted, credentials resolve through a fallback chain:

  1. Persona/profile/virtualModel resolution may produce a providerConfigId from the resolved entity
  2. If still absent, the adapter receives a sentinel context and falls back to environment variables or local tooling (see createSentinelProviderContext)

Renamed from the legacy wire name providerId for clarity — this points to a ProviderConfig instance, not a ProviderDefinition.

optional reasoningEffort?: "none" | "low" | "medium" | "high" | "extra-high"

Reasoning effort level. Overrides resolved reasoning effort.

optional systemPrompt?: string | { content: string; mode: "append"; }

System prompt configuration.

  • string: Replace/set the entire system prompt.
  • { mode: 'append', content: string }: Append to the resolved system prompt.

canonical-model: object

Defined in: ../../../packages/contracts/src/canonical-model/selection.ts:22

[key: string]: unknown

optional allowedDirectories?: string[]

Directory restrictions for file-system tool execution.

  • undefined: no restriction (use adapter/runtime defaults)
  • []: deny all filesystem paths
  • non-empty array: restrict access to listed directories

optional allowedTools?: string[]

Allowed tool names (adapter-specific). Empty array = disable all tools.

optional cwd?: string

Working directory for agent execution.

optional disallowedTools?: string[]

Disallowed tool names (adapter-specific). Takes precedence over allowedTools.

kind: "canonical-model"

Discriminant for transient canonical-model resolution.

model: string

Canonical model string such as 'sonnet' or 'anthropic::sonnet'.

optional providerConfigId?: string

Provider config UUID — “use these credentials.”

Links to a user-created ProviderConfigRecord with endpoint overrides and credentials. Orthogonal to resolution strategy: resolution produces an adapter + model, this field selects which account/credentials to use for the API call.

When omitted, credentials resolve through a fallback chain:

  1. Persona/profile/virtualModel resolution may produce a providerConfigId from the resolved entity
  2. If still absent, the adapter receives a sentinel context and falls back to environment variables or local tooling (see createSentinelProviderContext)

Renamed from the legacy wire name providerId for clarity — this points to a ProviderConfig instance, not a ProviderDefinition.

optional reasoningEffort?: "none" | "low" | "medium" | "high" | "extra-high"

Reasoning effort level. Overrides resolved reasoning effort.

optional systemPrompt?: string | { content: string; mode: "append"; }

System prompt configuration.

  • string: Replace/set the entire system prompt.
  • { mode: 'append', content: string }: Append to the resolved system prompt.