// Gateway-layer WIRE contract types: model identity, request/response shapes, streaming envelope,
// and tool-call normalisation. Credential-bearing or runtime-port shapes (ModelProviderConfig,
// GatewayConfig, CircuitBreakerConfig, ProviderAdapter, Clock, CircuitBreakerStatus) STAY in
// packages/keiko-model-gateway/src/types.ts so contracts never carries an apiKey-shaped surface. No runtime code lives
// here. `readonly` everywhere; optional props are `| undefined` because exactOptionalPropertyTypes
// is on.
// Bumped to 2 by issue #143 (Epic #142 Conversation Center): ModelCapability now carries
// supportsImageInput / supportsDocumentInput / workflowEligible. A future structural break
// adds a new literal member rather than mutating this constant.
export const CONVERSATION_CAPABILITY_CONTRACT_VERSION = 2;
// Why: see header — only `kind === "chat"` is conversation-eligible by
// construction. Pure, total, no side effects.
export function isConversationEligibleModel(capability) {
    return capability.kind === "chat";
}
// Why: returns a typed reason the UI can map to a localisable explanation
// without leaking provider URLs or credentials. Returns `undefined` for
// chat-eligible capabilities so callers can branch on presence. The lookup
// is total over `Exclude<ModelKind, "chat">` by construction — if a future
// `ModelKind` member is added in a CONVERSATION_CAPABILITY_CONTRACT_VERSION
// bump, this map will fail to typecheck (mandatory key missing), forcing the
// new member to be classified explicitly rather than silently leaking
// through as conversation-eligible.
const INELIGIBILITY_REASON_BY_KIND = {
    embedding: "embedding-only",
    "ocr-vision": "ocr-vision-only",
};
export function explainConversationIneligibility(capability) {
    if (capability.kind === "chat")
        return undefined;
    return INELIGIBILITY_REASON_BY_KIND[capability.kind];
}
