···56565757// ResolvePDS finds the PDS endpoint for a given DID using plc.directory
5858func (c *Client) ResolvePDS(ctx context.Context, did string) (string, error) {
5959- // 1. Try describeRepo first (if we are on the AppView, it works and is faster)
6060- desc, err := atproto.RepoDescribeRepo(ctx, c.XRPC, did)
6161- if err == nil && desc.DidDoc != nil {
6262- // Parse the DidDoc from the response
6363- // Note: indigo might return it as a map or struct.
6464- // Let's rely on the public directory if this fails or is complex to parse from the generic type.
6565- // Actually, let's just use the PLC directory directly for simplicity and reliability.
6666- }
6767-6868- // 2. Fallback to PLC Directory
6959 req, err := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://plc.directory/%s", did), nil)
7060 if err != nil {
7161 return "", err