( wires: Partial<Record<WireShape, string>>, agentId: string, )
| 58 | |
| 59 | /** Pick the wire an agent should use from a credential's capabilities (null = none compatible). */ |
| 60 | export function pickAgentWire( |
| 61 | wires: Partial<Record<WireShape, string>>, |
| 62 | agentId: string, |
| 63 | ): { shape: WireShape; baseUrl: string } | null { |
| 64 | const pref = AGENT_WIRE_PREFERENCE[agentId] ?? SHAPE_ORDER |
| 65 | for (const shape of pref) { |
| 66 | if (shape in wires) return { shape, baseUrl: wires[shape] ?? '' } |
| 67 | } |
| 68 | return null |
| 69 | } |
| 70 | |
| 71 | function schemaProps(schema: Preset['schema']): Record<string, Record<string, unknown>> { |
| 72 | return (schema?.properties as Record<string, Record<string, unknown>>) ?? {} |
no outgoing calls
no test coverage detected