( wires: Partial<Record<CredentialWireShape, string>>, agentId: string, )
| 86 | |
| 87 | /** Pick the wire an agent should use from a credential's capabilities (null = none compatible). */ |
| 88 | export function pickAgentWire( |
| 89 | wires: Partial<Record<CredentialWireShape, string>>, |
| 90 | agentId: string, |
| 91 | ): { shape: CredentialWireShape; baseUrl: string } | null { |
| 92 | const pref = AGENT_WIRE_PREFERENCE[agentId] ?? ['openai-chat', 'anthropic', 'openai-responses'] |
| 93 | for (const shape of pref) { |
| 94 | if (shape in wires) return { shape, baseUrl: wires[shape] ?? '' } |
| 95 | } |
| 96 | return null |
| 97 | } |
| 98 | |
| 99 | export interface CredentialInjectionOverrides { |
| 100 | /** Model id to run. Required in practice (a credential has none). */ |
no outgoing calls
no test coverage detected